UINavigationBar Hide back Button Text(UINavigationBar 隐藏按钮文本)
问题描述
如何隐藏 UINavigation 控制器的后退按钮文本?我只会有<"而不是<返回"
How can I hide the Back Button Text from an UINavigation Controller? I will only have the "<" and not "< Back"
推荐答案
在界面构建器中,可以选择上一个控制器的导航项,更改Back Button 字符串到您希望后退按钮显示的内容.如果你想让它空白,例如,只需放置一个空格.
In the interface builder, you can select the navigation item of the previous controller and change the Back Button string to what you'd like the back button to appear as. If you want it blank, for example, just put a space.
你也可以用这行代码改变它:
[self.navigationItem.backBarButtonItem setTitle:@"Title here"];
或者在 Swift 中:
self.navigationItem.backBarButtonItem?.title = ""
这篇关于UINavigationBar 隐藏按钮文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:UINavigationBar 隐藏按钮文本
基础教程推荐
- Android Volley - 如何动画图像加载? 2022-01-01
- 如何比较两个 NSDate:哪个是最近的? 2022-01-01
- 为什么姜饼模拟器方向卡在应用程序中? 2022-01-01
- iOS - UINavigationController 添加多个正确的项目? 2022-01-01
- 如何将图像从一项活动发送到另一项活动? 2022-01-01
- navigationItem.backBarButtonItem 不工作?为什么上一个菜单仍然显示为按钮? 2022-01-01
- Play 商店的设备兼容性问题 2022-01-01
- SwiftUI-ScrollViewReader的ScrollTo不滚动 2022-01-01
- Xcode UIView.init(frame:) 只能在主线程中使用 2022-01-01
- UIImage 在开始时不适合 UIScrollView 2022-01-01
