SwiftUI NavigationView Bug on iPad

  1. Execute the code below in iPad landscape mode.
  2. Go to the home screen and launch another app.
  3. When you return to the app again, you can see that the layout of the left menu is wrong.

This doesn't happen every time, but it does happen about 80% of the time.

As a first aid, if you specify .frame(width: 320) in the List, the problem no longer occurs.

Please let me know if you have a solution


macOS : 12.1 Beta (21C5031d) XCode : Version 13.1 (13A1030d) iPad : 15.2 (19C5036e)


struct ContentView: View {
  var body: some View {
    NavigationView {
      List {
        ForEach(1...9, id: \.self) { item in
          NavigationLink("\(item)") {
            Text("\(item)")
          }
        }
      }
    }
  }
}
SwiftUI NavigationView Bug on iPad
 
 
Q