iOS 13中的modalPresentationStyle默认值
根据苹果公司的文件 此属性的默认值为UIModalPresentationStyle.automatic 在iOS 12中,默认值是UIModalPresentationStyle.fullScreen,这就是我得到的 但当我在iOS 13上运行我的应用程序时,我得到的是作为navigationController.modalPresentationStyle的iOS 13中的modalPresentationStyle默认值,ios,swift,uiviewcontroller,uimodalpresentationstyle,Ios,Swift,Uiviewcontroller,Uimodalpresentationstyle,根据苹果公司的文件 此属性的默认值为UIModalPresentationStyle.automatic 在iOS 12中,默认值是UIModalPresentationStyle.fullScreen,这就是我得到的 但当我在iOS 13上运行我的应用程序时,我得到的是作为navigationController.modalPresentationStyle的.pageSheet 是否有我做错了什么,或者默认值是.pageSheet?演示样式是自动的,在iOS 13中,当您以模式演示viewc
.pageSheet
是否有我做错了什么,或者默认值是.pageSheet?演示样式是自动的,在iOS 13中,当您以模式演示viewcontroller时,默认为pageSheet
UIModalPresentationStyle.automatic在.pageSheet和.fullScreen之间切换,具体取决于显示UIViewController的上下文
如果您使用的是普通UIViewController,它将默认为.pageSheet
但如果您使用的是UIViewController的某些子类,如UIImagePickerControlleriOS希望内容应处于全屏模式,因此它将默认为。全屏
如果您使用的是iOS版本小于13,它将始终默认为.fullscreen
系统选择的默认显示样式。它是
UIModalPresentationAutomatic
自动意味着如果我们使用UIImagePickerController
和sourceType.photoLibrary
,它将以级联视图的形式出现。和sourceType.camera
,则它将全屏显示