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

查看:31
本文介绍了隐藏导航控制器后退按钮 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中获得了Back",然后上面的就可以了.

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天全站免登陆