Strange behavior of NavigationView() after rotate to landscape mode on iPhone 8

I found an interesting issue with NavigationView.


Here is the simple code:

import SwiftUI

struct ContentView: View {
    var body: some View {
        NavigationView {
            ZStack {
                Color(.lightGray)
                    .edgesIgnoringSafeArea(.all)

                Text("hello world")
            }
                .navigationBarTitle("", displayMode: .inline)
                .navigationBarItems(leading: Button(action: {
                    print("Edit button tapped")
                }, label: {
                    Text("Edit")
                }))
        }
            .navigationViewStyle(StackNavigationViewStyle())
    }
}


When I'm trying to run on iPhone 8 simulator in portrait mode and rotate to landscape I see something strange with position of NavigationView(). After the second rotate everything become as expected.


Looks like this is a bug in SDK.


Xcode 11.5

iOS 13.5


Any thoughts?


Thanks

I see something strange with position of NavigationView()


What do you see ?

What did you expect ?


I just notice some delay to rotate the navigation Bar, so it appears on the left for half a second before showing on top.

You should test on a real device, to see if it is a simulator performance issue.

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.
Strange behavior of NavigationView() after rotate to landscape mode on iPhone 8
 
 
Q