How to hide the bar button item on click of a button?

廉价感情. 提交于 2019-12-11 05:57:09

问题


in my app say i have 2 pages on click on next button(using push view controller) in page 1 it ill navigate to 2nd page , in the 2nd page i have a download(UIButton , not in the navigation bar) button , on click of that i need to hide the back button

if back button is created by us we can hide it by using the following code

self.navigationItem.leftBarButtonItem = nil;

but i am not getting how to hide that back button,,can any one help me, thanx in advance


回答1:


You can hide the back button using the following code:

[self.navigationItem setHidesBackButton:YES animated:YES];

See this answer for more details: How to hide the "back" button in UINavigationController?




回答2:


You can do...

self.navigationItem.hidesBackButton = YES;



来源:https://stackoverflow.com/questions/7202698/how-to-hide-the-bar-button-item-on-click-of-a-button

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!