隐藏导航控制器后退按钮iOS 7 [英] Hide Navigation Controller Back Button iOS 7

查看:125
本文介绍了隐藏导航控制器后退按钮iOS 7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过在我的 viewDidLoad 方法中添加以下行来隐藏导航控制器中的后退按钮。关于SO的许多其他先前的答案都说这有效,所以我不知道我的问题是什么?也许是iOS 7 / Xcode 5的新功能?

I have tried to hide the back button in my navigation controller by adding the following lines to my viewDidLoad method. Many other previous answers on SO have said this works, so I don't know what my problem is? Maybe something new with iOS 7 / Xcode 5?

self.navigationItem.hidesBackButton = YES;
self.navigationController.navigationItem.hidesBackButton = YES;


推荐答案

我也遇到过类似的问题。
仅当您未自定义导航栏时,此功能才有效。
以下任何一个都可以使用。

I too had faced similar issue. This will work only when you have not customized your Navigation bar. Either one of the below one will work.

[self.navigationItem setHidesBackButton:YES animated:YES];   OR
[self.navigationItem setHidesBackButton:YES];

请检查您是否在 iOS 7中获得返回,然后上面的方法就可以了。

Please check whether your getting "Back" in iOS 7, then the above will work.

希望这有助于你找出问题

Hope this will help you to identify the issue

这篇关于隐藏导航控制器后退按钮iOS 7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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