Ios 在显示ViewController后,如何在SFSafariViewController中禁用滑动手势
我已经编写了以下代码来禁用SFSafariViewController中的滑动弹出手势。但它不起作用Ios 在显示ViewController后,如何在SFSafariViewController中禁用滑动手势,ios,objective-c,iphone,Ios,Objective C,Iphone,我已经编写了以下代码来禁用SFSafariViewController中的滑动弹出手势。但它不起作用 self.navigationController.interactivePopGestureRecognizer.enabled = NO; self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self; 但它从未被称为。请帮助我
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
self.navigationController.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
但它从未被称为。请帮助我禁用弹出手势。请覆盖PresentationControllerShouldDisclose,并在该方法中返回false
- (BOOL)presentationControllerShouldDismiss:(UIPresentationController *)presentationController{
return NO;
}
或者可以尝试将SFSafariViewController对象的modalInPresentation参数设置为YES吗?因为按照上面说的
此属性的默认值为“否”。将其设置为“是”时,
UIKit忽略视图控制器边界之外的事件并防止
视图控制器在屏幕上时的交互取消
我已继承SFSafariViewController并写入-(BOOL)PresentationControllerShouldDisease:(UIPresentationController*)presentationController{return NO;},但未调用此委托方法。确定后,请尝试设置modalInPresentation=NO;在继承的类中。
- (BOOL)presentationControllerShouldDismiss:(UIPresentationController *)presentationController{
return NO;
}