Questions tagged [hstack]

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

This document contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

HStack - SwiftUI | Apple Developer Documentation

153 questions
0
votes
0 answers

Using Buttons to add shapes in SwiftUI

I am just starting out with SwiftUI so excuse me for some silly mistakes. I am trying to make something that will add a shape when the button is pressed and remove it when pressed again. It works well with just one button but starts to act weird…
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
3 answers

How to image setup in hstack under Swiftui

I followed the @swiftPunk answer it's working fine. But at the last point I stuck on my first image is not showing properly. Please check attached screenshot. Updated Code:- struct ImageStackRoundUpr: View { var friendRiders = ["DTR-CentrImg.jpeg",…
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
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
1 answer

SwiftUI How do I record the index of the grid item that is currently being displayed on CollectionView?

I am trying to have a scrolling horizontal list of items, where each item takes up almost the full screen width (UIScreen.main.bounds.width - 50). There should be just enough of the next item visible for the user to know there is something to…
Crystal
  • 46
  • 7
0
votes
1 answer

Show color on full screen in SwiftUI

I'm trying to show red color in full screen. If I use edgesIgnoringSafeArea(.all) the screen automatically becomes scrolling enabled, which I don't want. Can you please advise me how to show red color on full screen without scrolling and without…
Sham Dhiman
  • 1,348
  • 1
  • 21
  • 59
0
votes
1 answer

cannot stack numpy arrays with hstack in numba

I have one matrix mat of the type array([[0.00000000e+00, 1.98300000e+03, 1.57400000e+00, ..., nan, nan, 2.38395652e+00], [0.00000000e+00, 1.98400000e+03, 1.80600000e+00, ..., nan,…
user9875321__
  • 195
  • 12
0
votes
1 answer

How can I add fixed-width space to beginning of HStack?

In SwiftUI I am adding buttons to an HStack. I want a space of a fixed width at the beginning of the HStack. Currently the buttons are directly up against the left edge of the screen and I want a space of 64px before the first button. I cannot seem…
Nate Birkholz
  • 2,739
  • 4
  • 20
  • 29
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
1 answer

pandas: Buffer has wrong number of dimensions (expected 1, got 2) when using hstack

I am trying to hstack some values using np. However I get the following error: Buffer has wrong number of dimensions (expected 1, got 2) The line in which I stack is: s= np.hstack((np.array([cell_name,…
Mee
  • 1,413
  • 5
  • 24
  • 40
0
votes
2 answers

SwiftUI Text going out of screen in HStack

I tried everything but .lineLimit(nil), .fixedSize(horizontal: true, vertical: false), .fixedSize(horizontal: false, vertical: true) not working, and I don't know how could I place the texts in the next line if it's going out of screen. The texts…
sandorb
  • 479
  • 1
  • 7
  • 17
0
votes
1 answer

HStack with images expanding beyond screen

I'm trying to implement a view that has a subview that just renders an array of images. The number of images to draw varies. This is my main view: var body: some View { List { if !routeTrips.isEmpty { ForEach(routeTrips, id:…
kyrers
  • 489
  • 1
  • 6
  • 22
0
votes
1 answer

How to create SwiftUI HStack that adjusts to accommodate the expansion of one of its subviews?

I have a simple horizontal stack comprising three colour bars: When the yellow bar width is magnified via a gesture, I would expect the purple bar to move to the right to accommodate the expanded yellow bar but instead the yellow bar simply expands…
Robert
  • 231
  • 3
  • 10
0
votes
1 answer

array numpy regression linear

I have an numpy array that has 3 rows and 3 columns .Like this: 100 200 300 233 699 999 566 655 895 and I want to create a numpy array like this for my linear regression: 100 200 300 1 233 699 999 1 566 655 895 1 This my…
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