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

前端 未结 18 1992
后悔当初
后悔当初 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:56

    Set reference to nil:

    current_controller_in_navcontroller.navigationItem.rightBarButtonItem =  nil;
    

    Also be sure to call this in the controller currently shown by the navController, not for the navController itself.

提交回复
热议问题