Fixing ZStack size issue.
This commit is contained in:
parent
c3c58b7b39
commit
53031289de
@ -13,3 +13,5 @@ The last one is the best for my needs.
|
|||||||
|
|
||||||
The goal right now is to produce.
|
The goal right now is to produce.
|
||||||
Some questions persist.
|
Some questions persist.
|
||||||
|
|
||||||
|
Fix ZStack size : https://stackoverflow.com/questions/77969499/content-in-a-full-screen-zstack-not-centering-as-expected
|
||||||
|
@ -12,14 +12,15 @@ struct ContentView: View {
|
|||||||
@State private var capturedImage: UIImage?
|
@State private var capturedImage: UIImage?
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
|
ZStack {
|
||||||
if capturedImage == nil {
|
if capturedImage == nil {
|
||||||
CustomCameraView(capturedImage: $capturedImage)
|
CustomCameraView(capturedImage: $capturedImage)
|
||||||
.ignoresSafeArea()
|
} else {
|
||||||
} else {
|
PhotoPreviewView(capturedImage: $capturedImage)
|
||||||
PhotoPreviewView(capturedImage: $capturedImage)
|
}
|
||||||
.ignoresSafeArea()
|
|
||||||
}
|
}
|
||||||
|
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||||
|
.ignoresSafeArea(edges: [.top, .bottom])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,6 @@ struct PhotoPreviewView: View {
|
|||||||
.padding(.leading, 42)
|
.padding(.leading, 42)
|
||||||
.padding(.top, 62)
|
.padding(.top, 62)
|
||||||
}
|
}
|
||||||
.ignoresSafeArea()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user