I'm trying to code the "Sign up" part of my app. I'm using Large Title for that. If I use normal ViewControllers, everything is good, but if I use TableViewController, I have a really bad transition when I change the ViewController:
I can see a black background. Do you have any idea about how I could correct this?
EDIT: If I set isTranslucent = true, it's okay, but I would like to have a white NavigationBar. Do you know how to do that?
override func viewDidLoad(){
super.viewDidLoad()
if #available(iOS 11.0, *) {
// tableView.contentInsetAdjustmentBehavior = .never
self.navigationController?.navigationBar.prefersLargeTitles = true
}
self.navigationController?.navigationBar.isTranslucent = false
self.navigationController?.navigationBar.shadowImage = UIImage()
}
@IBAction func continueAction(_ sender: Any) {
let signupSecondVC = self.storyboard?.instantiateViewController(withIdentifier: "SignupSecondViewController") as! SignupSecondViewController
self.navigationController?.pushViewController(signupSecondVC, animated: true)
}
EDIT 2:
let img = UIImage(named: "backgroundNav")
navigationController?.navigationBar.setBackgroundImage(img, for: .default)
The NavigationBar is still translucent, even if the imageBackground is opaque ...
将导航栏的isTranslucent
设置为true
并通过它的backgroundImage
来控制其颜色。
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.