ipad侧滑白屏,禁止侧滑返回手势

plist文件中添加下面2个



- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// 禁用返回手势
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}


- (void)viewDidLoad {

[super viewDidLoad];
self.navigationController.interactivePopGestureRecognizer.enabled = NO;

id traget = self.navigationController.interactivePopGestureRecognizer.delegate;
UIPanGestureRecognizer * pan = [[UIPanGestureRecognizer alloc]initWithTarget:traget action:nil];
[self.view addGestureRecognizer:pan]; // 一定要加在view上

}




Loading Disqus comments...
Table of Contents