如何隐藏“背部"?UINavigationController 中的按钮?

2023-05-17移动开发问题
1

本文介绍了如何隐藏“背部"?UINavigationController 中的按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

限时送ChatGPT账号..

你知道如何在 UINavigationController 中隐藏返回"按钮吗?还有,怎么显示回来,不过我想这和隐藏很相似……

Do you know how to hide the 'back' button in a UINavigationController? Also, how to show it back, but I guess that's very similar to hiding it...

就像您在查看电子邮件时点击编辑"时 iPhone 上的邮件应用程序一样.

Just like the mail application does on the iPhone when you hit 'Edit' while viewing emails.

推荐答案

我刚刚找到答案,在控制器中使用这个:

I just found out the answer, in a controller use this:

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

然后恢复它:

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

--

[更新]

斯威夫特 3.0:

self.navigationItem.setHidesBackButton(true, animated:true)

这篇关于如何隐藏“背部"?UINavigationController 中的按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

The End

相关推荐

硬件音量按钮更改应用程序音量
Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)...
2024-08-12 移动开发问题
10

Cocos2d - 如何检查不同层中对象之间的交集
Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)...
2024-08-12 移动开发问题
8

恢复游戏 cocos2d
Resume game cocos2d(恢复游戏 cocos2d)...
2024-08-12 移动开发问题
6

突出显示朗读文本(在 iPhone 的故事书类型应用程序中)
Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))...
2024-08-12 移动开发问题
9

Cocos2D + 仅禁用 Retina iPad 图形
Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)...
2024-08-12 移动开发问题
10

正确的 cocos2d 场景重启?
Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)...
2024-08-12 移动开发问题
7