如何在单击按钮时隐藏条形按钮项? [英] How to hide the bar button item on click of a button?
问题描述
在我的应用中,说我在第1页上单击下一个按钮(使用推式视图控制器)有2页,它将无法导航到第2页,在第2页上我有一个download(UIButton,不在导航栏中)按钮,单击此按钮后,我需要隐藏后退按钮
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;
self.navigationItem.leftBarButtonItem = nil;
但是我不知道如何隐藏该后退按钮,任何人都可以帮助我,谢谢.
but i am not getting how to hide that back button,,can any one help me, thanx in advance
推荐答案
您可以使用以下代码隐藏后退按钮:
You can hide the back button using the following code:
[self.navigationItem setHidesBackButton:YES animated:YES];
有关更多详细信息,请参见以下答案: 如何隐藏后退"按钮UINavigationController中的按钮?
See this answer for more details: How to hide the "back" button in UINavigationController?
这篇关于如何在单击按钮时隐藏条形按钮项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!