iPhone PushViewController 保留导航栏的右侧部分
在 iPhone 应用程序中,我希望根导航控制器的导航栏右侧有一个导航按钮。然而,每次我将另一个 viewController 推到导航控制器顶部并且右侧插槽变空时,这个右侧按钮都会消失。我怎样才能确保它保留在正确的位置。我正在使用界面生成器。
据我了解,“iOS 视图控制器编程指南”说,我正在推送的新 viewController 必须将其 navigationController 属性设置为当前导航控制器,但是该属性是只读的。我怎样才能实现这个目标?
In an iPhone app I want to have a navigation button on the right side of the navigation bar of the root navigation controller. However this right button disappears every time I push another viewController on top of the navigation controller and the right slot becomes empty. How can I make sure it remains on its proper place. I am using Interface Builder.
The "View Controller Programming Guide for iOS", as I understand it, says that the new viewController I'm pushing has to have its navigationController property set to the current navigation controller, however this property is readonly. How can I achieve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这就是导航控制器的问题
左侧栏按钮由 iOS 自动为所有视图控制器获取
但是你必须为特定的ViewController设计Rightbarbutton
所以对于ViewDidLoad中的每个ViewController
This is the thing with Navigation controller
The left bar button is taken Automatically by the iOS for All viewControllers
But you have to design the Rightbarbutton for the Specific ViewController
So for each ViewController in ViewDidLoad