简体   繁体   中英

UIViewController presented without background

When im present new VC background is clear and I can see previous VC.

Second VC is empty (without any view)

How FIX?

let vc = AddScrollVC()
let navController = UINavigationController(rootViewController: vc)
navController.modalPresentationStyle = .overFullScreen
present(navController, animated: true)

在此处输入图像描述

Second VC is presented, shown only button in navBar

You can solve the issue with replacing this code

let VC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "PresentVC") as! PresentVC
VC.modalPresentationStyle = .overFullScreen
self.present(VC, animated: true, completion: nil)

Change the code like this, This is work fine for me

let VC = PresentVC()
VC.modalPresentationStyle = .overFullScreen
self.present(VC, animated: true, completion: nil)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM