![](/img/trans.png)
[英]Is there a a way to disable swipe back animation in Safari on iOS?
[英]iOS 7 disable the swipe back
在iOS应用程序中,有一个默认手势,从左边缘向右滑动,app navigationController
将弹出视图控制器。
但是有没有办法为特定视图禁用它?
您可以通过公共API禁用它,请参阅UINavigationController类参考
//iOS7 Customization, swipe to pop gesture
if ([navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
navigationController.interactivePopGestureRecognizer.enabled = NO;
}
此外,您可以在需要时切换回以前的状态
if(navigationController) {
if ([navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}
它可能但可能是你拒绝应用的原因
-(void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.