标签:
考虑到interactivePopGestureRecognizer也有delegate属性,替换默认的self.navigationController.interactivePopGestureRecognizer.delegate来配置右滑返回的表现也是可行的。在主ViewController中:
- (void)viewDidLoad {
[super viewDidLoad];
self.navigationController.interactivePopGestureRecognizer.delegate = self;// 重新指定代理
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if (self.navigationController.viewControllers.count == 1) { // 关闭主界面的右滑返回 return NO; } else { return YES; } }
解决自定义leftBarButtonItem返回手势失效的方法
标签:
原文地址:http://www.cnblogs.com/dabaomo/p/5450487.html