SwiftUI list view with GroupedListStyle and horizontalSizeClass regular breaks on iOS 13.5 when turned to landscape mode

Looks like iOS 13.5 introduced a new bug, this is not reproducible in iOS 13.3. When using the following code and turn to landscape mode with device that has notch, the text inside the list gets cut off. Does anyone have any workaround or fix? Filed a bug report to Apple.

Code Block swift
var body: some View {
List {
Text("Some Text")
}
.listStyle(GroupedListStyle())
.environment(\.horizontalSizeClass, .regular)
}


Answered by gomfucius in 617058022
Hi, thanks for your post Chad. I'm using the horizontalSizeClass because I want that rounded rectangle style in the list instead of looking like the traditional UITableView look.

This issue has been fixed in Xcode 12 beta and iOS 14 beta.
Don’t set horizontalSizeClass, that fixed it for me.

Why are you setting it anyway? This is a value that is set by the system and probably should not be overridden.
Accepted Answer
Hi, thanks for your post Chad. I'm using the horizontalSizeClass because I want that rounded rectangle style in the list instead of looking like the traditional UITableView look.

This issue has been fixed in Xcode 12 beta and iOS 14 beta.
SwiftUI list view with GroupedListStyle and horizontalSizeClass regular breaks on iOS 13.5 when turned to landscape mode
 
 
Q