没有“后退”的导航控制器按钮
在我的应用程序中,我得到了视图,用户在其中添加新对象,然后单击“保存”按钮并转到主视图。但之后我们在主视图上看到“后退”按钮。我可以在没有“后退”按钮的情况下执行此操作(新对象 -> 主窗口)吗?
In my app i got view, where user adds new object, then he clicks on the "save" button and goes to main view. But after that we see "back" button on the main view. Can i do this segue (new object -> main window) without "back" button?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您从 VC1 导航到 VC2。
如果你想在进入 VC2 时隐藏后退按钮。
只需在 VC2 中编写此内容
即可
If you are navigating from VC1 to VC2.
If you want hide back button when you goto VC2.
Just write this in VC2
OR
如果其他人无法正常工作,则将
'self.navigationItem.hidesBackButton = YES;'
中时对我不起作用
放入
'- (id)initWithNibName:(NSString *)nibNameOrNil 捆绑包:(NSBundle *)nibBundleOrNil'
。我将其移至
'- (void)viewDidLoad'
,现在它可以完美运行。我正在使用 Xcode 4.5.2。In case anyone else is having trouble getting this to work,
'self.navigationItem.hidesBackButton = YES;'
didn't work for me when placed in
'- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil'
.I moved it to
'- (void)viewDidLoad'
and it now works perfectly. I'm using Xcode 4.5.2.在推送的视图控制器上设置 self.navigationItem.hidesBackButton = YES 。
Set
self.navigationItem.hidesBackButton = YES
on the pushed view controller.然后将其连接到一个按钮。
Then connect it to a button.