How do I hide/show the right button in the Navigation Bar

前端 未结 18 2018
后悔当初
后悔当初 2020-12-12 19:25

I need to hide the right button in the Navigation Bar, then unhide it after the user selects some options.

Unfortunately, the following doesn\'t work:



        
18条回答
  •  甜味超标
    2020-12-12 19:59

    For Swift 3

    if let button = self.navigationItem.rightBarButtonItem {
                        button.isEnabled = false
                        button.tintColor = UIColor.clear
                    }`
    

提交回复
热议问题