A Swift UI view that arranges its children in a vertical line.
Questions tagged [vstack]
193 questions
0
votes
1 answer
Result of 'Zstack' initializer is unused
I'm a beginner (started a week ago) in SwiftUI and trying out different things with app development. I'm stuck with Zstack not being able to execute anything.
This is multiplatform app, and when I simulate it, it's just blank white space.
When I…

Jon Lee
- 1
0
votes
1 answer
Views in VStack overlapping
So I am having trouble with the view TopBar in a VStack -- it keeps overlapping with the Image I have beneath it and messing up the ret of the formatting for that view. I've looked through similar threads and actually fixed an issue I was having…

Erin Donahue
- 23
- 6
0
votes
1 answer
save multiples variables in python
this is my script its having some problem. I just want to save tree variables a1, a2, a3 using numpy savetxt after vstacking them. Its working well when all the variables (a1, a2, a3) are found in the loop. It getting problems when ether one of them…
0
votes
1 answer
Future Warning: Arrays to stack
when I try to use the following functions:
x_bounds = np.array([[ 1., 100.],
[ 0.01, 1.],
[ 0., 1.]])
def generate_x_mesh ():
X = np.meshgrid( np.linspace(*x_bounds[0], num=20), # x_1
…

Isabel Waibel
- 11
- 3
0
votes
1 answer
Getting VStack to shrink to minWidth when containing Text SwiftUI
I'm still somewhat new to SwiftUI and I'm getting a weird case that I don't fully understand. Basically, I have a VStack that contains some Text Views but also has a background View. Ideally, I'd like the background to grow in width as much as it…

Jason Brady
- 1,560
- 1
- 17
- 40
0
votes
2 answers
Content inside VStack shrinks when embedded inside a ScrollView in SwiftUI
I have a simple login screen with two textfield and a button. It should look like this. The two textfields closer together and the button a little ways down.
Here is my code.
struct ContentView: View {
var body: some View {
VStack {
…

Isuru
- 30,617
- 60
- 187
- 303
0
votes
0 answers
vstack results in out of sync audio
When I stack two videos using vstack, the result has audio sync issues for the bottom video.
My starting point: four separate RTP tracks captured from a 2 person video chat:
Actor1Video.webm,
Actor1Audio.webm,
Actor2Video.webm,
…

Arlo
- 31
- 3
0
votes
0 answers
How to align elements from different stacks/containers in swiftui?
I would like to build a screen with SwiftUI which consists out of three HStacks. Each of these HStacks has a VStack with a button and some text under the button.
How can I make sure that the buttons are all aligned in the center regardless how long…

ulrike_hansel
- 115
- 1
- 6
0
votes
2 answers
Move VStack at the top of the page swiftUI
I want to create a top bar and my code looks like this:
struct MyView: View {
var body: some View {
VStack(alignment: .leading) {
Bar()
Spacer()
}
}
}
struct Bar: View {
var body: some View {
…

Johnas
- 296
- 2
- 5
- 15
0
votes
0 answers
Vstack to get array
Im trying to put the vector i get from z in A and from q in B and then stacking them together. arr is an array from image of size (600,478). M=600, N=478. For some reason the matrix i get out is not the right one.
def avgdif(M):
…

bajsmackan
- 13
- 3
0
votes
1 answer
how vstack works according to numpy documentation
Python Beginner here.After going through numpy documentation which says vstack is equivalent to concatenation along the first axis after 1-D arrays of shape (N,) have been reshaped to (1,N).
So the below code
a = np.array([[1], [2], [3]])
b =…

Sandeep Kumar
- 53
- 1
- 4
0
votes
0 answers
How to watch the ScrollView's scroll offset in another view?
I want to implement a visual effect as below the gif shows:
And I try to use a ZStack which wraps a title bar view and a ScrollView, and the opacity of the title bar changes with the scroll offset changes, is there a way to get the current offet of…

Dictator
- 105
- 1
- 9
0
votes
3 answers
SwiftUI: Manipulate spaces between buttons in HStack
I'm implementing an alert view and the alert view has two buttons:
Submit is one button and Cancel is another button but way to close to the center. There is a way to control the position of the buttons?
Here is my implementation:
var body: some…

user2924482
- 8,380
- 23
- 89
- 173
0
votes
1 answer
SwiftUI VStack Animation looks broken - Animated View will not change position
Let's take a look at the following Code Snippet:
struct ContentView: View {
@State private var isViewHidden: Bool = false
let data = [1,2,3,4,5,6,7]
public var body: some View {
VStack {
Button("Hide", action: {
…

Sebastian Boldt
- 5,283
- 9
- 52
- 64
0
votes
1 answer
How to disable position animation in SwiftUI?
I want to scroll a VStack programmatically and some of child views can be animated independently, but when changing the VStack's offset the animated child view move to its final position witth animation, that's not what I want and how to disable…

Dictator
- 105
- 1
- 9