Questions tagged [zstack]

68 questions
0
votes
1 answer

SwiftUI - To resize the ZStack to the size of the image?

I have a picture and text wrapped in a ZStack and I would like the ZStack to be the shape of the picture but when I put the background in one color, two stripes appear on each side of the picture. My code : ZStack { Image(schema.image) …
MxM
  • 199
  • 1
  • 3
  • 12
0
votes
1 answer

Text field problems Xcode

I’m creating an app and need to make a signup/login page. I added a background using a picture and a zstack and on top I have the text and text fields. The text fields are showing up but not allowing me to add padding as well as there is no title…
Benjo
  • 1
  • 1
0
votes
1 answer

Having Problems Setting View Background Color with List View--SwiftUI

I want to set the View Background color to green. I have a List View and it's fine but the underlying view needs to be green--see image. I know I'm missing something but with SwiftUI you sometimes don't know if it's a bug or just how the thing is…
gosborne3
  • 47
  • 1
  • 9
0
votes
1 answer

How do I keep clipped content of one subview from blocking gestures in underlying subviews with SwiftUI?

I have a main view consisting of a zStack with a background image at the bottom, a user-loaded image above that, and two toolbars at the top. The toolbars are at the vertical top and bottom of the view. I want those toolbars to appear…
Jesse
  • 25
  • 7
0
votes
2 answers

SwiftUI: How to overlay an image with multiple shapes and dependent positioning

I'd like to place several shapes(Rectangles) over an image but the rectangles should have fixed positions on the image. So no matter what screen-size or screen-orientation, a rectangle should always cover the same content of the image. So in the…
sonja
  • 924
  • 1
  • 21
  • 52
0
votes
2 answers

SwiftUI - animating View opacity in ZStack with .easeInOut

I have a view sitting on top of a mapView (in a ZStack) and want to be able to have the green, upper view fade in and out with the .easeInOut animation modifier applied to the view's opacity. As you can see in the gif, it fades in nicely but…
Magnas
  • 3,832
  • 5
  • 33
  • 48
-1
votes
1 answer

How can I measure an item inside of a VStack in SwiftUI?

I am building an app for iOS in Xcode. New with this, as you can see. I created a VStack, with 3 rectangles in it, all of them taking al the width of the screen (the app is only portrait): First one is 140px high. Second one is variable, depending…
Frikeando
  • 1
  • 2
-1
votes
2 answers

SwiftUI ZStack first element is not displayed

I'm new to SwiftUI, and I have a simple app with a ZStack: struct ContentView: View { @State var num : Int = 1 var body: some View { NavigationView{ ZStack{ Text("asd") …
Nadav Holtzman
  • 210
  • 4
  • 13
1 2 3 4
5