iOS 13更新后遇到的问题 - 模态跳转

[self presentViewController:vc  animated:YES completion:nil];

iOS13更新后,模态跳出的页面,没有完全到顶,导致底部被遮挡。

/*

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.

*/

官方文档有解释,iOS13之后默认为 UIModalPresentationAutomatic,在iOS13之前默认为UIModalPresentationFullScreen,所以只需要设置一下跳转模式即可。

vc.modalPresentationStyle = UIModalPresentationFullScreen;

或者 vc.modalPresentationStyle =0;

[self presentViewController:vc  animated:YES completion:nil];

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容