Override horizontally compact environment behaviour for modalPresentationStyle of '.formSheet'

廉价感情. 提交于 2020-07-22 12:30:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!