美文网首页
IOS13的新特性,模态弹出禁用和启动下滑返回、全屏

IOS13的新特性,模态弹出禁用和启动下滑返回、全屏

作者: WMSmile | 来源:发表于2020-05-20 11:58 被阅读0次

今天遇到,模态弹出下滑返回,下滑返回和我本身的画图页面的滑动手势冲突,于是禁用下滑返回。

let autoGraphVc = AutoGraphVC()
autoGraphVc.delegate = self
autoGraphVc.modalPresentationStyle = UIModalPresentationStyle.fullScreen;
if #available(iOS 13.0, *) {
    autoGraphVc.isModalInPresentation = true
} else {
    // Fallback on earlier versions
}
self.superSelf?.present(UINavigationController(rootViewController:autoGraphVc), animated: true, completion: nil)

禁用下滑手势

UIViewController 的属性 isModalInPresentation 设为true 就能禁用下滑返回了 默认为 false

模态弹出全屏显示

UIViewController 的属性 modalPresentationStyle 控制模态弹出的类型 iOS 13之后,默认UIModalPresentationStyle.automatic,需要重新设置UIModalPresentationStyle.fullScreen就可以全屏幕

相关文章

网友评论

      本文标题:IOS13的新特性,模态弹出禁用和启动下滑返回、全屏

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