您的位置:首页 > 移动开发 > IOS开发

iOS开发 自定义navigationleftItem 之后手势失效的问题

2016-01-20 23:46 375 查看
@property (nonatomic, strong) UIViewController *currentShowVC;

//设置代理

self.navigationController.interactivePopGestureRecognizer.delegate =(id)self;

self.navigationController.interactivePopGestureRecognizer.enabled = YES;

if (self.navigationController.viewControllers.count == 1){

//将当前导航控制器置空

self.currentShowVC = Nil;

}else{

self.currentShowVC = self;

}

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer

{

if (gestureRecognizer == self.navigationController.interactivePopGestureRecognizer) {

//the most important

return (self.currentShowVC == self.navigationController.topViewController);

}

return YES;

}

self.navigationController.interactivePopGestureRecognizer.delegate = self;


待整理。。。。。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: