same problem here
already tried fresh Xcode installation on a fresh Mac OS as well
Apple, you should fix that issue ASAP!
Post
Replies
Boosts
Views
Activity
Try to use AnyView() this way:
struct ContentView: View {
var body: some View {
self.myStack(content: AnyView(Text("hello")))
}
func myStack(content: AnyView) -> some View {
ZStack{
if false {
HStack(alignment: .center, spacing: 0) {
content
}
} else {
VStack(alignment: .center, spacing: 0) {
content
}
}
}
}
}
This forum does not accept my reply with a link to a screenshot.
I see that the whole navigation view and inner Hello world text using half of a screen on landscape mode instead of the whole screen. But after next rotate the issue disappears and everything looks good as expected.
Unfortunately I don't have a real device where I can reproduce that issue. Everything looks good on latest devices.
Also this issue does not appear if you remove .navigationBarItems() from the code.