1.

    override func viewDidLoad() {

        super.viewDidLoad()

        self.navigationController?.delegate = self

    }

2. 实现代理方法

// MARK: - 导航栏代理, 只在本页面隐藏 导航栏
extension JYStaffListController:UINavigationControllerDelegate{
    func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool) {
        
        if viewController is JYStaffListController{
            self.navigationController?.navigationBar.shadowImage = UIImage.init(named: "testImage")
        }else{
            self.navigationController?.setupNewNav()
        }
    }
}

  

posted on 2018-07-26 11:08  懂事长qingzZ  阅读(193)  评论(0编辑  收藏  举报