'`.safeAreaInset(edge:…)` ignored on physical device? iOS-Bug?
I wanted to inset a list with .safeAreaInset() like so:
List {
Text("Hello, world!")
.padding(100)
Text("Hello, world!")
.padding(100)
Text("Hello, world!")
.padding(100)
Text("Hello, world!")
.padding(100)
}
.safeAreaInset(edge: .top) {
Text("top")
.padding(100)
.background(Color.red)
}
.safeAreaInset(edge: .leading) {
Text("leading")
.padding(100)
.background(Color.green)
}
.safeAreaInset(edge: .trailing) {
Text("trailing")
.padding(100)
.background(Color.blue)
}
.safeAreaInset(edge: .bottom) {
Text("bottom")
.padding(100)
.background(Color.purple)
}
While this seems to work as expected on all iPhone/iPad simulators, I am having trouble to understand why it looks like the added safe area insets are ignored on a physical iPad (and not on a physical iPhone).
Expected result (scrolled all the way up); list is inset
Expected result (scrolled all the way down); list is inset
Result on physical device (scrolled all the way up); safe area insets ignored
Result on physical device (scrolled all the way down); safe area insets ignored
Do I miss something? Some kind of accessibility feature or whatever on the iPad? Is this is a bug? Are there any known good workarounds?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
