Open
Description
Problem scenario:
- start app in portrait mode (landscape mode is not really an option here on iPhone)
- rotate phone for landscape mode
- enter README screen in landscape mode
—> bug: can only close screen by switching to portrait mode (or closing app)
The problem also shows up in the Preferences screen.
No problem if:
- above scenario, running on iPad (not tested on iPhone Plus/Max)
- or switching to landscape within README screen - you should have the idea to go back to portrait
- or switching to landscape before opening the app on iPhone (iPhone Home Screen doesn’t support landscape)
Solution
Adjust sheet settings for iPhone? Is this an app bug or a SwiftUI bug?
.sheet(isPresented: $showingPreferences, content: {
PreferencesView(preferences: $model.preferences)
// the detents don't do anything on an iPad
.presentationDetents(detentsList, selection: $selectedPreferencesDetent)
.presentationBackground(.regularMaterial) // doesn't work yet with PreferencesView
.presentationCornerRadius(40)
.presentationDragIndicator(.visible) // show drag indicator
})
See comment by Paul Hudson: https://www.hackingwithswift.com/quick-start/swiftui/how-to-display-a-bottom-sheet