问题
When presenting a UIViewController with modalPresentationStyle = .formSheet
, Horizontally compact environment behaves same as UIModalPresentationStyle.fullScreen
According to Apple's Documentation
UIModalPresentationStyle.formSheet.
In a horizontally regular environment, the view controller is sized so that its content area is smaller than the screen size and a dimming view is placed underneath the content. If the device is in a landscape orientation and the keyboard is visible, the position of the view is adjusted upward so that the view remains visible. All uncovered areas are dimmed to prevent the user from interacting with them.
In a horizontally compact environment, this option behaves the same as UIModalPresentationStyle.fullScreen.
It looks like Apple Maps settings screen is presented with modalPresentationStyle = .formSheet
but for Horizontally compact environment, it doesn't cover fullscreen but it covers only half the screen.
How can we override the behaviour for Horizontally Compact environment so that it covers only the half of the screen?
来源:https://stackoverflow.com/questions/57182883/override-horizontally-compact-environment-behaviour-for-modalpresentationstyle-o