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.
|
||||
Some questions persist.
|
||||
|
||||
Fix ZStack size : https://stackoverflow.com/questions/77969499/content-in-a-full-screen-zstack-not-centering-as-expected
|
||||
|
@ -12,15 +12,16 @@ struct ContentView: View {
|
||||
@State private var capturedImage: UIImage?
|
||||
|
||||
var body: some View {
|
||||
|
||||
ZStack {
|
||||
if capturedImage == nil {
|
||||
CustomCameraView(capturedImage: $capturedImage)
|
||||
.ignoresSafeArea()
|
||||
} else {
|
||||
PhotoPreviewView(capturedImage: $capturedImage)
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.ignoresSafeArea(edges: [.top, .bottom])
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
|
@ -28,7 +28,6 @@ struct PhotoPreviewView: View {
|
||||
.padding(.leading, 42)
|
||||
.padding(.top, 62)
|
||||
}
|
||||
.ignoresSafeArea()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user