Swift iOS13 模态出来的页面(不全屏)

能不能负点责根本不好使

众所周知modalPresentationStyle是这个属性默认为automatic导致的,但是网上都写

self.modalPresentationStyle = .fullScreen

什么玩仍能行不?

正确写法

// 跳转到登陆页面模态
let loginVC: LoginVC = LoginVC.init()
loginVC.modalPresentationStyle = .fullScreen
self.present(loginVC, animated: true, completion: nil)
// Finish Thank you

想要导航栏

let loginVC: LoginVC = LoginVC.init()
let navigationLoginVC = UINavigationController.init(rootViewController: loginVC)
navigationLoginVC.modalPresentationStyle = .fullScreen
self.present(navigationLoginVC, animated: true, completion: nil)
// Finish Thank you

你可能感兴趣的:(Swift iOS13 模态出来的页面(不全屏))