Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
2 votes
2 answers
109 views

I would like the view show on top to prevent the covered view from receiving any mouse event. According to How to prevent the ZStack lower level View from reacting?, I can disable the covered view. ...
Guig's user avatar
  • 10.6k
0 votes
0 answers
58 views

I’m building a custom bottom sheet in SwiftUI using ZStack. Everything works fine when I just preview the bottom sheet alone, or when the ZStack is not occupied by any other elements. However, as soon ...
user26550408's user avatar
-1 votes
1 answer
101 views

I want to create a custom class for a stack that will show some kind of stacked cards effect like so: It will be used on top of the Main / Root container. The stack will be aligned at the bottom of ...
Bawenang Rukmoko Pardian Putra's user avatar
1 vote
1 answer
117 views

I have a close or dismiss view button on an iOS app that I am trying to place in the upper left hand of a SwiftUI View. The button has an image within it and it action is to dismiss the view. To the ...
user6631314's user avatar
  • 2,050
1 vote
2 answers
117 views

I'm newish to SwiftUI and trying to understand how I can keep one view horizontally centered on the device screen, while anchoring an additional view to its trailing edge (without uncentering the ...
Kpmurphy91's user avatar
0 votes
0 answers
47 views

I'm working with SwiftUI and I have a rectangle inside a ZStack that I want to rotate. However, the rotation is happening around the center of the entire ZStack, not the center of the rectangle itself....
user29193503's user avatar
0 votes
1 answer
291 views

I am trying to create a horizontal scroll view in SwiftUI where I can move only one item at a time, and I want to maintain the proportions of the peeking view (i.e., the portion of the item that ...
Moran's user avatar
  • 15
0 votes
0 answers
76 views

this is my ContentView() struct ContentView: View { @State private var selectedTab: Tab = .view1 var body: some View { NavigationView{ ZStack{ Color(.green) ...
kislay p's user avatar
1 vote
1 answer
108 views

I am new to SwiftUI and hoping to understand why LinearGradient() is not working when applied to a ZStack, followed by a NavigationStack. Any guidance would be appreciated! var body: some View { ...
FightingWombat's user avatar
0 votes
1 answer
62 views

We have vertically aligned multiple labels and top tight Image is align to first label. If first label has not enough content then second label will be move up and vice versa. image height will be ...
Vishal Desai's user avatar
0 votes
1 answer
571 views

I want to display a list of images. Each image have an associated text, and I want to display that text like a "popover" in style (but how it is achieved is not important - it doesn't have ...
Per Lindgren's user avatar
0 votes
1 answer
2k views

Consider the following (in a landscape-only app): struct ContentView: View { var body: some View { ZStack { Rectangle() .foregroundColor(.blue) .frame(width: UIScreen....
soleil's user avatar
  • 13.3k
2 votes
2 answers
2k views

Consider the following view: var body: some View { GeometryReader { geo in ZStack { HStack(spacing: 0) { VStack { Text("...
soleil's user avatar
  • 13.3k
0 votes
1 answer
426 views

Lets say in SwiftUI we have a problem where we want a View that consists of: An overall frame of reference in the form of an aspect ratio (the View will always have this aspect ratio) A basic (or ...
Nerdy Bunz's user avatar
  • 7,743
3 votes
3 answers
602 views

In a screen design, I am showing a sheet from the bottom, and in this section I want to move an image above the sheet part. In this part, when I move it up with offset, it only remains in the sheet, ...
Tayfun Sağdıç's user avatar
4 votes
2 answers
1k views

I am working on a SwiftUI view that displays an image fetched from a URL using AsyncImage. I want the image to fill the entire screen, and I have a row of buttons overlaid at the bottom of the image ...
Raeein Bagheri's user avatar
0 votes
1 answer
99 views

Main Content View: struct ContentView: View { @State var editing: Bool = false @State var inputText: String = "" @State var vOffset: CGFloat = 0 @State var hOffset: ...
Ios Dev's user avatar
1 vote
2 answers
111 views

I'm following this SwiftUI tutorial and encountered an issue with the positioning of badgeSymbols in Badge.swift. Here's the relevant code: Badge.swift: (where the repositioning is applied) import ...
Nerdy Bunz's user avatar
  • 7,743
0 votes
2 answers
197 views

SwiftUI ScrollView can't scroll all down to all the content of the included ZStack. struct TestView: View { var colors: [Color] = [.red, .orange, .yellow, .green, .mint, .teal, .cyan, .blue, ....
rich's user avatar
  • 3
1 vote
2 answers
1k views

I'm facing some challenges to layout this prototype in SwiftUI. I used ZStack to layout the views. But my main problem is to position the profile image view's first half on the top the red background ...
Poles's user avatar
  • 3,682
0 votes
0 answers
50 views

When someone clicks on Notification, I want to show a view. However, I still want tabs visible at the bottom of the screen so they can go back to whatever tab they want. I tried adding invisible ...
Student's user avatar
  • 89
0 votes
1 answer
829 views

I have a ScrollView with some text in it and I want to use .overlay for an Image to start after last Text or element from the view. In a simple way I used Color to showcase what I have and what I want ...
s_diaconu's user avatar
  • 315
1 vote
1 answer
115 views

My code is as bellow: struct Clock10View: View { let light: Bool var body: some View { ZStack() { Rectangle() .frame(width: 6, height: 6) ....
mars's user avatar
  • 497
-1 votes
1 answer
210 views

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 ...
Frikeando's user avatar
2 votes
1 answer
194 views

I have a map pin view that represents an action. This is the code VStack { ActionView(action: place.actions.first!) .frame(width: 35,...
n savoini's user avatar
  • 552
1 vote
1 answer
935 views

If I take a ZStack and add a bunch of Model3D views to it (to arrange them in 2D space), the ZStack will give each successive view an adjustment to the z-axis, such that they appear to be placed on ...
Ben Gottlieb's user avatar
  • 85.5k
1 vote
0 answers
801 views

I've run into a very strange issue. I have a SwiftUI app (iOS) where I have a full-screen ZStack: inside, as a "bottom layer", I have a full-screen Map, and on top I have a button (it is ...
Dmytro Titov's user avatar
  • 3,311
0 votes
1 answer
956 views

I'm having problems showing fullscreen popups in SwiftUI. My app structure is a MainView with a TabView with 2 tabs. This is a sample of my app structure: struct UIMainView: View { var body: ...
Wonton's user avatar
  • 1,143
0 votes
3 answers
188 views

I am having a problem with HStack which has bigger width than the parent view showing centre not leading. struct WidgetEntryView : View { var entry: Provider.Entry var body: some View { ...
Alejandro's user avatar
1 vote
1 answer
1k views

I'm learning SwiftUI. When I have a ZStack say ZStack { Image(systemName: "globe") .imageScale(.large) .foregroundColor(.accentColor) Text("Hello, world!") } ...
newbie py's user avatar
0 votes
2 answers
153 views

The VStack has two components header and detail. When we tap on the "show" button, it shows the View (header + detail of the VStack). However, it results in Flashing effect when the view ...
NNikN's user avatar
  • 3,858
1 vote
1 answer
75 views

I have a RocketView View to view SpaceX rockets with the SpaceX API. I have an issue with ZStack or VStack in the RocketCell View where the cell is not showing the whole image in the list. How can I ...
NinjaDeveloper's user avatar
0 votes
2 answers
803 views

I'm struggling on creating two vertical bars with lines and dash box. I would like to receive some suggestion on how to do this. This is what I'm aiming to do: Currently this is my code. import ...
David Edson's user avatar
0 votes
1 answer
114 views

I have two circles on a Zstack, but they are not aligned if the view is rendered on NavigationView. struct SpinnerView: View { @State private var isLoading = false var body: some View { ...
Rocker's user avatar
  • 1,269
6 votes
1 answer
8k views

I've got a little swiftUI program that displays photos from a given day as stacks of photos for each year. Simplified code below. I read the photos into resultPhotos as a dictionary with each key ...
Martin's user avatar
  • 1,662
0 votes
1 answer
57 views

I am applying rotation gesture and magnify gesture in a ZStack. But the ZStack is not getting rotated , but the image inside the ZStack is getting rotated and scaled upon the gesture while I did ...
dipon_the_pro_coder's user avatar
0 votes
1 answer
468 views

I have a Stack I am using to create a graph with 2 different lines, but I also want to have 2 labels on the graph. I want these labels to be in the top left of the ZStack but cannot figure out how. ...
tHatpart's user avatar
  • 1,186
1 vote
1 answer
834 views

I have a LazyVStack of Post Views with images in those views (similar to Instagram). When I'm zooming in on one of the images, I would like for that image to overlap over all other content. However, ...
Sarth Shah's user avatar
0 votes
1 answer
248 views

When put Image to the bottom of ZStack , image just not showing struct ContentView: View { var body: some View { VStack{ ZStack{ Image(systemName:"...
Dikey's user avatar
  • 121
0 votes
3 answers
11k views

I'm trying to make an app and I want to have a background colour for the app so I put the colour in the assets folder but the colour only fills up 3 quarters of the screen, leaving the top half empty. ...
Zudoturiku's user avatar
0 votes
1 answer
176 views

I want to produce a bubble-like view with various pieces of text on a rounded rectangle background, sized to fit the text. I have arrived at this: var body: some View { HStack { ...
user avatar
1 vote
0 answers
268 views

I want to create some sort of banner view that either moves in or out with animations when some state changes in SwiftUI. It feels like a basic task to do but the transition when showing the banner is ...
ph1psG's user avatar
  • 748
-1 votes
2 answers
730 views

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{ ...
Nadav Holtzman's user avatar
1 vote
2 answers
2k views

I want to place an image either on top of, or between lines, depending on the position variable: struct ContentView: View { @State var position = 5 var body: some View { VStack(spacing: ...
Arvid's user avatar
  • 53
2 votes
2 answers
2k views

I'm trying to create a view composed of two parts - the top part is an image with a piece of text overlaid in the top left corner. The top part should take up 2/3 of the height of the view. The bottom ...
soleil's user avatar
  • 13.3k
-1 votes
1 answer
404 views

I have some vstack views, and a zstack view (its a dropdown menu). I need the top of the zstack view to align itself perfectly with the text of VStack 2 Text like this I think I need to utilize ...
Ungrace's user avatar
  • 324
0 votes
2 answers
572 views

A Text element inside a ZStack(alignment: .bottom) is displayed at the bottom of the container (as expected). Tho, if the same ZStack is inside a GeometryReader, the alignment does not behave the same ...
Dominik Seemayr's user avatar
3 votes
1 answer
900 views

Before scrolling starts, everything looks great with rounded corners displaying on the screen. The problem comes when user starts scrolling through the page, the top corners gets replaced by the ...
Ryan Fung's user avatar
  • 2,237
0 votes
1 answer
1k views

When I am trying to add a plus button, which is overlapped on two rows of the list. The code works fine for cases: 1) When view will appear, 2) Scrolling from top to bottom (Every time). However, the ...
iOSDev AI's user avatar
6 votes
2 answers
4k views

I have a view and I want to add two icons to it, at top right side and at bottom right side. I managed to do that: I used two ZStacks: ZStack(alignment: .bottomTrailing) { ZStack(alignment: ....
user121882's user avatar