我的应用程序是一个 ios phonegap 应用程序。我想从 Web 视图的文本字段中禁用复制和粘贴菜单。在长按和双击时,会显示复制粘贴菜单。我尝试使用 UIGestureRecognizer 类禁用长按和双击:
- (void)viewDidLoad{
UILongPressGestureRecognizer* longPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(gestureHandler:)];
[longPressGesture setMinimumPressDuration:0.2];
longPressGesture.delegate = self;
[self.webView addGestureRecognizer:longPressGesture];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
return NO;
}
else if([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]){
return NO;
}
else
return YES;
}
但我无法为双击禁用它。有相同查询的人吗?帮帮我...