NavigationController UINavigationBar后退按钮 [英] NavigationController UINavigationBar Back Button

查看:63
本文介绍了NavigationController UINavigationBar后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从Interface Builder中更改后退按钮的文本,但是当我选择导航栏并进入属性检查器并将后退按钮文本设置为关闭时,它仍会显示标题以前的观点。

I'm trying to change the text of the back button from within Interface Builder, but when I select the Navigation Bar and go into the Attributes Inspector and set the Back Button text to "Close" it still shows up with the title of the previous view.

如何让它工作?

推荐答案

后退按钮将始终显示之前的UIViewController标题或backBarButtonItem定义。

The back button will always show the previous UIViewController title or backBarButtonItem defined.

因此,如果您有view1并移至view2,则需要在view1中设置backButton,以便在显示view2时正确显示。

(换句话说 view1负责提供应该在指向它的后退按钮中显示的内容

这样,如果view1跟随任何视图,则所有这些视图都将具有正确的后退按钮。

So if you have "view1" and move to "view2" you need to set the backButton in "view1" so it's displayed correctly while "view2" is presented.
(In other word "view1" is responsible to provide what should be displayed in a back button that point to it)
In this way if "view1" is follow by any views all those will have the correct back button.

这篇关于NavigationController UINavigationBar后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆