Когда я представляю лист в обычном режиме, любой фон SwiftUI (даже простой Color.clear или .background(Color.red.opacity(0.5))) правильно отображается позади листа.
/>Но тут я добавляю:
.presentationDetents([.medium])
…тот же самый фон начинает отображаться над листом, хотя:
- он находится под листом в иерархии представлений
- он добавляется перед модификатором .sheet
Минимально воспроизводимый пример
struct LoginScreen: View {
Expected Behavior**
- The red background should remain **behind** the sheet.
- This is the case in iOS **18.5 / 18.6** and earlier versions.
- This is also the case as long as `.presentationDetents` is **not** used.
----------
## **Actual Behavior**
- On iOS **26.0 / 26.1**, when `.presentationDetents` is applied, the root background (and overlays) draw **above** the sheet.
- This happens even in the simplest ZStack setup.
- `.zIndex` does not fix the issue.
- `.overlay` exhibit the same incorrect ordering.
----------
## **Environment**
- Xcode 26.0.1
- iOS Simulator: 26.1
- Happens on both device and simulator
- SwiftUI sheet with `.presentationDetents`
----------
Is this a known regression with `.presentationDetents` behavior on iOS 26?
Is there a workaround that keeps the sheet above the app’s root backgrounds?
Any insight appreciated.
Подробнее здесь: https://stackoverflow.com/questions/798 ... tiondetent
Мобильная версия