Questions tagged [vstack]

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

103 questions
0
votes
1 answer

SWIFTUI How to capture VStack height with geometry (after the VStack was displayed)?

I'd like to ask you some help. I'm trying to capture VStack height using geometry and then based on that VStack height value, calculate its child element's height (inside VStack). Image of my current view of VStack I used .frame outside of VStack to…
Linas
  • 35
  • 5
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
  • 4,773
  • 3
  • 31
  • 58
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
  • 21
  • 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
  • 69
  • 6
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
  • 53,635
  • 12
  • 43
  • 52
0
votes
2 answers

Swift UI VStack align up. Make textfield appear with keyboard when pressing in it

I am having issues placing my "twitter" image higher in my view while using SwiftUI. I want to get the twitter image higher up for all closer to my two blob images, as well as add the spacing between the twitter image and the "Sign into my account"…
bain
  • 223
  • 3
  • 14
0
votes
1 answer

SwiftUI: VStack don't apply to white background color but every other color

I have following code. If I change .background(Color.green) to .background(Color.white) for the VStack the background will be the systemGray I used for the Listbackground. Has it something to do with the .colorMultiply(Color(UIColor.systemGray4))…
HansDeBeer
  • 127
  • 1
  • 9
0
votes
1 answer

How to stack the output of each iteration of a for loop?

I have two for loops that generate an array with the shape of (1, 3). I want to vertically stack the result of each iteration in an array. More clearly, the final output should be a (3, 3) array where the first row is the out of the first iteration…
Hey There
  • 277
  • 3
  • 10
0
votes
1 answer

leading edge for VStack in SwiftUI

I want to create a VStack of many Texts with 20 points of spacing between each Text. I want my VStack to be aligned to left side of the screen(or leading side of parent View).
arsalan_h
  • 43
  • 3
0
votes
1 answer

Is it possible to pad items in a VStack in a way that only pushes the items below it downward without pushing the items above it upwards?

It's a bit hard to word in the title but here's my situation. I have a VStack and I need to animate a gap forming below a tapped item in the stack. I've tried adding .padding(.bottom, isTapped ? 50 : 0) to the items for example, but it doesn't…
Kabir
  • 93
  • 5
-1
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
  • 129
  • 1
  • 10
-1
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,040
  • 2
  • 28
  • 45
-2
votes
2 answers

How can i iteratively stack rows in numpy using for loop

I am trying to iteratively add rows to my two dimensional np.array A = np.zeros((1,14),dtype = float) for i in arr: A = np.vstack(fn(i))# function returns array And as a result i always get only last array i stacked Can someone please…
1 2 3 4 5 6
7