如何在单击按钮时隐藏栏按钮项目?

发布于 2024-12-01 13:12:27 字数 292 浏览 5 评论 0原文

在我的应用程序中,我说我有 2 个页面,点击第 1 页中的下一个按钮(使用推送视图控制器),它将导航到第 2 页,在第 2 页中,我有一个下载(UIButton,不在导航栏中)按钮,单击其中我需要隐藏后退按钮 back

如果后退按钮是由我们创建的,我们可以使用以下代码隐藏它

self.navigationItem.leftBarButtonItem = nil;

但我不知道如何隐藏后退按钮,任何人都可以帮助我,提前谢谢

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 back

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

万劫不复 2024-12-08 13:12:27

您可以使用以下代码隐藏后退按钮:

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

有关更多详细信息,请参阅此答案:
如何隐藏 UINavigationController 中的“后退”按钮?

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?

踏雪无痕 2024-12-08 13:12:27

你可以做...

self.navigationItem.hidesBackButton = YES;

You can do...

self.navigationItem.hidesBackButton = YES;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文