美文网首页
iOS 13更新后遇到的问题 - 模态跳转

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

作者: 请叫我小仙女_ | 来源:发表于2019-11-20 16:38 被阅读0次

    [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];

    相关文章

      网友评论

          本文标题:iOS 13更新后遇到的问题 - 模态跳转

          本文链接:https://www.haomeiwen.com/subject/eqnoictx.html