简体   繁体   English

导航栏上的后退按钮文字太长

[英]Back button text too long on navigation bar

I'm working on my first iOS application. 我正在开发我的第一个iOS应用程序。 I'm using the navigation controller and I'm running into a small issue. 我正在使用导航控制器,但遇到了一个小问题。 The issue is that the back button's text is too long. 问题是后退按钮的文本太长。 Because the text is too long the title is not always centered. 由于文本太长,标题并不总是居中。 I thought about removing the back button but then I loose the swipe to go back feature. 我曾考虑过删除“后退”按钮,但是随后我松开了“后退”功能。 What is the best way to handle this? 处理此问题的最佳方法是什么?

您可以在每个要返回按钮的ViewController中使用它。

self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM