UINavigationBar change colors on push

后端 未结 4 1970
长情又很酷
长情又很酷 2020-12-23 17:49

I\'m using 2 different bar tint colors at UINavigationBar in different views. I\'n changing color with that method in both views:

override func          


        
4条回答
  •  盖世英雄少女心
    2020-12-23 17:57

    This worked for me:

     override func willMove(toParent parent: UIViewController?) {
          super.willMove(toParent: parent)
          navigationController?.navigationBar.barTintColor = previous view controller's navigation bar color
     }
    

提交回复
热议问题