
[self.navigationController.navigationItem setHIDesBackbutton:YES animated:YES];
但是这不是我需要的,而是要让后退按钮变灰,并且不响应用户触摸事件.他们是不是替换默认的返回按钮来实现的?
提前致谢!
解决方法 要禁用后退按钮,这些命令将使您执行所需的 *** 作:启用:
self.navigationController.navigationbar.userInteractionEnabled = YES;self.navigationController.navigationbar.tintcolor = [UIcolor bluecolor];
禁用:
self.navigationController.navigationbar.userInteractionEnabled = NO;self.navigationController.navigationbar.tintcolor = [UIcolor lightGraycolor];
更新:
从iOS 7开始,您也可以在UINavigationbar上禁用滑动.
// You wrap it an 'if' statement so it doesn't crashif ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {// disable the interactivePopGestureRecognizer self.navigationController.interactivePopGestureRecognizer.enabled = NO;} 总结 以上是内存溢出为你收集整理的objective-c – iOS 8 UINavigationController禁用后退按钮全部内容,希望文章能够帮你解决objective-c – iOS 8 UINavigationController禁用后退按钮所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)