隐藏导航控制器后退按钮 iOS 7

Hide Navigation Controller Back Button iOS 7(隐藏导航控制器后退按钮 iOS 7)
本文介绍了隐藏导航控制器后退按钮 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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)