A Swift UI view that arranges its children in a vertical line.
Questions tagged [vstack]
193 questions
1
vote
1 answer
Can anybody help me with my `for loops` using numpy vstack?
Say I have about 640 numpy arrays to stack vertically. Each array is of the size (66, 1). Doing this manually like this:
A = np.vstack((Ne['State_1_inc'], Ne['State_2_inc'], Ne['State_3_inc'], Ne['State_4_inc'], ..., Ne['State_640_inc']))
would…

vlaaaaaddd
- 19
- 5
1
vote
2 answers
How to build scrollable side menu using text rotation (or something similar) in SwiftUI?
I want to build a menu like the image bellow where I can scroll between menus. I did try multiple combinations with HStack/VStack in ScrollView and rotation modifier on Text and/or stacks. However, none of my attempts really works as…

Hans Rietmann
- 396
- 5
- 13
1
vote
2 answers
Move TextField up when the keyboard has appeared in horizontal ScrollView that is inside vertical ScrollView SwiftUI
There has been a question to something related a while ago:
Move TextField up when the keyboard has appeared in SwiftUI
It seems like the previous problem has been fixed. However, if we put the VStack in a ScrollView. SwiftUI seems to ignore the the…

NilsBerni
- 83
- 2
- 13
1
vote
1 answer
Remove spacing between HStacks embedded in Stack
I am trying to stack two HStacks filled with circles, however, no matter what I do, I cannot get rid of the spacing between the two.
VStack {
VStack(spacing: 0) {
HStack {
ForEach(viewModel.lights) {…

Thomas Braun
- 1,109
- 2
- 13
- 27
1
vote
2 answers
How to convert vstack code to for-loop (Python)?
I currently have a list (list_arr) containing 8 numpy arrays with the following sizes:
0. (6300, 6675, 3)
1. (5560, 6675, 3)
2. (5560, 6675, 3)
3. (5560, 6675, 3)
4. (6300, 6675, 3)
5. (5560, 6675, 3)
6. (5560, 6675, 3)
7. (5560, 6675, 3)
I want to…

Noah Vento
- 23
- 2
1
vote
2 answers
What does .T means in np.vstack function?
I wonder what is the meaning of .T in the function np.vstack(array1, array2, array3).T?

гиви
- 79
- 7
1
vote
1 answer
Beginner with SwiftUI: VStack with Form and List
I am a beginner with SwiftUI Layout (not in coding) and I have a problem
Here the code:
var body: some View {
NavigationView {
VStack {
Form {
TextField("Nome", text: $name)
}
…

MarcoGT
- 53
- 6
1
vote
1 answer
VStack .leading alignment
I can't get rid of this "leading" padding inside one of my VStacks.
I set alignment to "leading" for its parent VStack but it still shows some spacing on the left (for the text and red rounded rectangle). They were supposed to be placed on the left…

eugene_prg
- 948
- 2
- 12
- 25
1
vote
1 answer
How align columns for multiple items on a VStack on SwiftUI?
In the sample below, if I have a VStack followed for a HStack, how can I make the width of the HStack follow the same as a grid ?
struct VStackAlignmentView: View {
let data = ["a", "b", "cdefghl alalala", "i", "j"]
var body: some View {
…

Pedro Antunes
- 192
- 1
- 6
1
vote
1 answer
Vstack chiled Hstack elements do not distribute equally
I have two Hstack inside Vstack but Elements of Hstack are not distributed equally due to text length.
Due to Current task and Completed Task Text length my Hstack do not equally distribute. How can I achieved equally distribution?
I have to use…
1
vote
1 answer
SwiftUI: Overlay is on the whole VStack instead of the textfield after wrapping TextFields with VStack
Here's the simplified code:
var body: some View {
Section(header: Text("Personal Data").position(x:45, y: 17)) {
Form {
VStack {
TextField("Title", text: self.$title)
.disabled(true)
…
user12919782
1
vote
1 answer
UIView Top Point is Lower Then Expected
I have a format problem. How I want is the 2nd picture but for some reason, my view starts a little bit lower. You can see the gap between the pictures. I want to solve this problem without offset. Might be because of .navigationBarHidden(true)…

Mert Köksal
- 817
- 1
- 7
- 26
1
vote
0 answers
Why VStack has different behavior between iOS13 and iOS14?
In iOS13 VStack align its content center along the vertical direction, like this:
In iOS14 VStack align its content top along the vertical direction:
I use same code as below,
GeometryReader { geometry in
VStack(alignment: .leading, spacing:…

Dictator
- 105
- 1
- 9
1
vote
2 answers
SwiftUI - Align Text in a VStack
How to align a Text with left alignment in a VStack that is occupying more space like this
This is the code am using
VStack(alignment:.leading) {
Text("Test")
.font(.system(size: 10))
.frame(maxWidth: .infinity, maxHeight:…

Joe
- 11
- 1
- 2
1
vote
2 answers
LazyVStack scrolling stops animations
This code lists 100 rows with refresh icon animations. When using a LazyVStack instead of a VStack, after scrolling down to the bottom of this list all the animations stop, including those at the top of the list once you scroll back. No such…

andrewz
- 4,729
- 5
- 49
- 67