Questions tagged [vstack]

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

193 questions
0
votes
1 answer

Loop through entity array in SwiftUI to build tree-structured view based on values in array data

I'm totally new to Swift. I need to traverse an array, and based on what the data is, build out a custom tree structure. I would share my code but it's too bulky and too horrible to be seen in public. It's not even close to working. So here's some…
Joe Bell
  • 13
  • 3
0
votes
1 answer

SwiftUI - Is it possible to declare a Stack or Group as a property?

I first want to parse a large text file and collect all the necessary views before I finally display them. I have it working with an array of AnyView but it's really not nice since it erases all types. Basically, I just want a container to collect…
Big_Chair
  • 2,781
  • 3
  • 31
  • 58
0
votes
1 answer

How to set a Limit for the the views inside a HStack?

Good day, beginner SwiftUI & iOS developer here. I'm not quite sure how else I could've worded this question, but I'll try my best to explain what I would like to achieve. Right now, I have a VStack that contains a WebImage and Text view, and this…
lex
  • 113
  • 8
0
votes
1 answer

How to use `Button` to add new `VStack` by using `SwiftUI`

I am using iOS 14 and Xcode 12 to learn SwiftUI. I want to use Button to add new or more VStacks\. Anyone know how to use the buttons and add a new VStack? Any help would be appreciate. This is my code. Button(action: { VStack{ …
SimpsonHuang
  • 43
  • 1
  • 6
0
votes
1 answer

Swift UI adjust VStack children height to content height

I have a VStack with three children. Each of those children have an HStack with some text and an empty space on the left. Here is a screenshot of the preview with a highlighted border around a VStack child, and one with a highlighted border around…
John Sorensen
  • 710
  • 6
  • 29
0
votes
1 answer

Show and Hide Everything in a VStack

I have a custom SwiftUI View where in an HStack I have two VStacks on opposite ends. I need each to have its own double-tap gesture to show and hide the items in the VStack. Here is what I have tried: @State var displayRewind = false VStack { …
Luke Irvin
  • 1,179
  • 1
  • 20
  • 39
0
votes
2 answers

How do I vstack or concatenate matricies of different shapes?

In a situation like the one below, how do I vstack the two matrices? import numpy as np a = np.array([[3,3,3],[3,3,3],[3,3,3]]) b = np.array([[2,2],[2,2],[2,2]]) a = np.vstack([a, b]) Output: ValueError: all the input array dimensions for the…
C.L.
  • 106
  • 6
0
votes
1 answer

How can I create an extension for a VStack with properties in SwiftUI?

I would like to apply a list of properties to a VStack instead of a shape. The following code is applying my list of properties to a shape through innerN function that is defined in a Shape extension: ZStack { Color.mph let shape =…
Abv
  • 354
  • 2
  • 13
0
votes
1 answer

SwiftUI - What is ZStack and what is its difference with VStack?

I'm new to SwiftUI, sometimes instructor uses VStack and sometimes ZStack not able to understand the difference ...
Hafiza
  • 800
  • 8
  • 15
0
votes
1 answer

SwitUI - VStack - Jumping when text entered

I am developing a basic passcode entry screen, consisting off a top Stack to display currently entry, then some HStack's displaying the numbers VStack(){ HStack(spacing: 20){ ForEach(codes,id: \.self){i in …
Display Name
  • 1,025
  • 2
  • 15
  • 34
0
votes
0 answers

In a SwiftUI VStack how do I make multiple Text Views, each with multiple lines of text, the same width

I'm trying to make the text in the VStack the same width but don't know how. I saw it suggested elsewhere to set a frame maxWidth to .infinity for each of the Text Views but it doesn't have any effect when I try it in my code. This is the code I…
0
votes
1 answer

how to make a VStack span all space?

I'm trying to eliminate the space that the top stack covers, but as much as I need the image to cover the space where the time is shown and the battery is not successful, does anyone have any idea how to do it? I leave a photo of what I want to…
user13485448
0
votes
1 answer

Numpy - Replacing hstack/vstack if-loop with something faster (append?)

I want to combine several (say 15) long arrays of shape (3072,) into one np.array of shape (15,3072). If have found a solution but that's including a nested if-clause in a for-loop, which seems to be inefficient for me. Is there a more efficient…
0
votes
0 answers

How do you clip VStack children views that exceeds the screen's safe area?

I'm new to SwiftUI and have a question regarding how to setup a VStack relative to the safe area of the screen. I'm currently writing an app that will have a single sign-in/sign-up button in the log-in screen. The idea is that if the email address…
0
votes
0 answers

SwiftUI VStack align child items to top

Kindly help, I have a view that uses a CustomView. In Custom view there are 2 lists in vertical Stack, the issue here is there's always a space between 2 lists even when using Spacer? struct CustomView: View { var body: some View{ …
TapulaRasa
  • 325
  • 3
  • 13