一:如果自定义了返回按钮,如果右滑手势失效那么在基类添加下面代码
#pragma mark 修改自定义返回按钮之后 右滑不能返回问题
-(void)viewWillDisappear:(BOOL)animated { [super viewWillDisappear:animated]; //代理置空,否则会闪退 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.delegate = nil; } }
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; //开启iOS7的滑动返回效果 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { //只有在二级页面生效 if ([self.navigationController.viewControllers count] == 2) { self.navigationController.interactivePopGestureRecognizer.delegate = self; } } }
二:
网友评论