美文网首页
ios 13 presentViewController

ios 13 presentViewController

作者: 90后的晨仔 | 来源:发表于2020-03-27 15:28 被阅读0次

在ios 13 系统中 presentViewController 默认是最新UIModalPresentationAutomatic模式,如果还需要保持原来的推出方式就必须指定模式为UIModalPresentationFullScreen

typedef NS_ENUM(NSInteger, UIModalPresentationStyle) {
    UIModalPresentationFullScreen = 0,
    UIModalPresentationPageSheet API_AVAILABLE(ios(3.2)) API_UNAVAILABLE(tvos),
    UIModalPresentationFormSheet API_AVAILABLE(ios(3.2)) API_UNAVAILABLE(tvos),
    UIModalPresentationCurrentContext API_AVAILABLE(ios(3.2)),
    UIModalPresentationCustom API_AVAILABLE(ios(7.0)),
    UIModalPresentationOverFullScreen API_AVAILABLE(ios(8.0)),
    UIModalPresentationOverCurrentContext API_AVAILABLE(ios(8.0)),
    UIModalPresentationPopover API_AVAILABLE(ios(8.0)) API_UNAVAILABLE(tvos),
    UIModalPresentationBlurOverFullScreen API_AVAILABLE(tvos(11.0)) API_UNAVAILABLE(ios) API_UNAVAILABLE(watchos),
    UIModalPresentationNone API_AVAILABLE(ios(7.0)) = -1,
    UIModalPresentationAutomatic API_AVAILABLE(ios(13.0)) = -2,
};
开发中在跳转前指定退出控制器的模式就好了:
UIViewController * testVC = [[UIViewController alloc] init];
 controller.modalPresentationStyle = UIModalPresentationFullScreen;
    [rootControl presentViewController:testVC animated:NO completion:nil];

相关文章

网友评论

      本文标题:ios 13 presentViewController

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