iOS 开发继续加油

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

2019-10-21  本文已影响0人  _君莫笑_

能不能负点责根本不好使

众所周知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
上一篇下一篇

猜你喜欢

热点阅读