导航栏基础属性设置
1.设置导航栏颜色
self.navigationController?.navigationBar.barTintColor = UIColor(red: 112/255, green: 194/255, blue: 158/255, alpha: 1)
导航栏之间的跳转
1.压栈
self.navigationController.pushViewCntroller。。。
2.返回上一层
self.navigationController?.popViewControllerAnimated(true)
3.返回指定界面
self.navigationController?.popToViewController(viewController as! UIViewController, animated: true)
4.返回跟视图
self.navigationController?.popToRootViewControllerAnimated(true)
5.代码跳转导航栏
let vc = viewcontroller()
let nav = UINavigationController(rootViewController: vc)
self.window.rootViewController(vc)
网友评论