Questions tagged [vstack]

A Swift UI view that arranges its children in a vertical line.

193 questions
0
votes
1 answer

Sizing multiple vstack width in scroll view, SwiftUI

I have a VStack: VStack(alignment: .leading) { Text(question) .fontWeight(.heavy) .font(.system(.footnote, design: .rounded)) .padding(.bottom) Text(answer) .fontWeight(.semibold) …
Gurmukh Singh
  • 1,875
  • 3
  • 24
  • 62
0
votes
1 answer

Fixing VStack in relation to the main view so that it stays in the same place even if page is scrolled

How do I fix a VStack relative to the main view, which means it always stays in the same place even if the page is scrolled. I have tried using overlays, ZStack and so on. However, I have not had much luck with it. The below image shows an example…
NotAPhoenix
  • 171
  • 4
  • 15
0
votes
1 answer

How to get a simple SwiftUI to load as a UITableView would (logically!)

How can I get SwiftUI to load 8 images horizontally but if the third image happens to go off screen it puts it in a Vstack underneath the 1st image with the same padding... and if three can fit on the screen it does the same to the 4th. I can not…
RealTechyGod
  • 121
  • 1
  • 1
  • 11
0
votes
2 answers

How to align the center of a VStack to a point SwiftUI

I have 5 VStacks in an HStack that spans the width of the screen. The VStack contains Text Views that are all different widths because they display different text. What I want to do is align the center of each VStack so that they are evenly apart…
coder
  • 381
  • 2
  • 22
0
votes
1 answer

How to make vstack or vertical paging this view?

I am developing the app like below screen. I want these two kind of view. one is horizontal range view vertical scroll card view. basically the view should be behind to one other. and it can scroll vertically. and i need animation to one card view…
Noorul
  • 3,386
  • 3
  • 32
  • 54
0
votes
1 answer

How to dynamically adjust the number of items in a row within a vertically scrollable VStack in SwiftUI?

Input: I have a list of View where each View is a VStack of an Image and Text Requirement: I want to display them vertical scrollable view. However, each row should have more than one of such Views (based on how many can fit). [Note that Views are…
user3213210
  • 113
  • 1
  • 2
  • 9
0
votes
1 answer

How to display some text when a button is clicked in Swift UI?

I have a function that displays "correct" when the user puts in the right answer. func displayCorrectOrIncorrect() -> some View { Group { if correctAnswer == quiz.answer { VStack { Text("Correct") } } else { …
0
votes
1 answer

Use LazyVStack in SwiftUI 1

One of the new features of SwiftUI 2 are LazyVStacks. Is it possible to implement its functionality in the current SwiftUI framework? I have the following code sample where I want to use it: var body : some View { VStack(alignment: .leading){ …
randomdev8712
  • 261
  • 1
  • 6
  • 23
0
votes
2 answers

Is it possible to get the calculated "minimum" height for a VStack in Swift UI

I'm working with a card-like view, and I would essentialy like to know the minimum height needed to house the elements, and then add a border around that. this becomes difficult since VStack and HStack seem to want to take up the most space…
austin
  • 405
  • 4
  • 12
0
votes
0 answers

SwiftUI Text in between Images is not aligned properly

Having a simple SwiftUI view: VStack { Image("AnIcon") Text("AAA").font(.system(size: 100)) Image("AnIcon") } the spacings above and below the Text differ. If I replace the two images by Text, The texts are directly adjacent to each…
Pavel Lobodinský
  • 1,028
  • 1
  • 12
  • 25
0
votes
1 answer

Pandas Dataframe to Numpy Vstack Array by Unique Column Value

I have a dataframe with following structure: import numpy as np import pandas as pd data = {'Group':['1', '1', '2', '2', '3', '3'], 'Value':[1, 2, 3, 4, 5, 6]} df = pd.DataFrame(data) I need to convert that dataframe (which has approx 4000…
Lageos
  • 183
  • 1
  • 9
0
votes
3 answers

SwiftUI layout inside VStack using ViewModifiers

I have a simple view with two texts. Its body is like this: VStack { Text("One") Text("Two") Text("Three") } this produces a view like: But what I would like is, using only modifiers to the Text views (i.e. no HStack with Spacers),…
KerrM
  • 5,139
  • 3
  • 35
  • 60
0
votes
2 answers

How do i prevent a form from taking up entire view

I have a Form and a Button in a VStack, but the form takes up nearly the entire view and the button is forced at the bottom. I am trying to make the button come right after the form, but so far my attempts with padding and spacer have failed. Anyone…
Eric Chang
  • 41
  • 1
0
votes
2 answers

Making items in HStack visible / invisible later

I have a game view that has a board and I have several parts in a VStack and the final 2 HStack are some 'buttons' and then a row of tiles for the game. VStack(spacing: 5) { HStack {} HStack {} ...... …
Lynxbci
  • 71
  • 7
0
votes
1 answer

Background for List Items on Apple Watch with SwiftUI

I'm working on building an Apple Watch screen in SwiftUI. The layout is working nicely, but there are aspects of the color styling that I can't seem to figure out. Here's my code: struct Watch3ThingsMainUI: View { var goals: [Goal] var…
Sean McMains
  • 57,907
  • 13
  • 47
  • 54
1 2 3
12
13