码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 禁止手势滑动翻页

时间:2016-04-20 13:32:34      阅读:195      评论:0      收藏:0      [点我收藏+]

标签:

- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];

// 禁用 iOS7 返回手势
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}

- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];

// 开启
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
}

iOS 禁止手势滑动翻页

标签:

原文地址:http://www.cnblogs.com/lihaibo-Leao/p/5411964.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!