iOS13 iPad上present一个页面,发现页面是一个小框框,一个模态的弹框
这是由于vc的modalPresentationStyle默认值在iOS13上有变化,原先默认都是UIModalPresentationFullScreen, 13变成了UIModalPresentationAutomatic,需要手动设置.
/*
Defines the presentation style that will be used for this view controller when it is presented modally. Set this property on the view controller to be presented, not the presenter.
If this property has been set to UIModalPresentationAutomatic, reading it will always return a concrete presentation style. By default UIViewController resolves UIModalPresentationAutomatic to UIModalPresentationPageSheet, but system-provided subclasses may resolve UIModalPresentationAutomatic to other concrete presentation styles. Participation in the resolution of UIModalPresentationAutomatic is reserved for system-provided view controllers.
Defaults to UIModalPresentationAutomatic on iOS starting in iOS 13.0, and UIModalPresentationFullScreen on previous versions. Defaults to UIModalPresentationFullScreen on all other platforms.
*/
@property(nonatomic,assign) UIModalPresentationStyle modalPresentationStyle API_AVAILABLE(ios(3.2));
在iOS13的iPad上,模态视图控制器的默认展示样式由全屏改为自动,导致呈现为小框。需手动设置modalPresentationStyle以解决。此属性应作用于待展示的视图控制器而非展示者。

612

被折叠的 条评论
为什么被折叠?



