简体   繁体   English

在iPhone App的导航栏上实现后退按钮

[英]Implement a Back Button on Navigation Bar in iPhone App

Just recently took over a project from my developer. 就在最近,我的开发人员接手了一个项目。 I'm a noob to coding, but can figure things out pretty well. 我对编码不熟悉,但是可以很好地解决问题。 I'm just trying to implement Back button on one of my screens. 我只是想在我的屏幕之一上实现“后退”按钮。 It already has the navigation Bar, but no back button, just the title. 它已经有导航栏,但没有后退按钮,只有标题。

Is there a guide on how to get this implemented? 是否有有关如何实现此目标的指南? Any help would be great! 任何帮助将是巨大的!

Thanks! 谢谢!

Update = Here is the code: 更新=这是代码:

<object class="IBUINavigationController" id="144954994">
<reference key="NSNextResponder" ref="191373211"/>
<int key="NSvFlags">290</int>
<string key="NSFrameSize">{320, 44}</string>
<reference key="NSSuperview" ref="191373211"/>
<bool key="IBUIOpaque">NO</bool>
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
<int key="IBUIBarStyle">2</int>
<object class="NSArray" key="IBUIItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUINavigationController" id="445217273">
<reference key="IBUINavigationController" ref="144954994"/>
<string key="IBUITitle">Answer Question</string>
</object>
</object>
</object>

如果您使用UINavigationController来控制视图堆栈,则在您推入新视图时会自动为您添加“后退”按钮。

Are you using UINavigationController's? 您是否在使用UINavigationController? If so, it's automatically put there when you push a view. 如果是这样,当您按下视图时,它将自动放置在此处。

(Update based on comment) Using a UINavigationBar (根据评论更新)使用UINavigationBar

http://developer.apple.com/iphone/library/documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html http://developer.apple.com/iphone/library/documentation/uikit/reference/UINavigationBar_Class/Reference/UINavigationBar.html

 bar.topItem.leftBarButtonItem = // set to a UIButton

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

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