Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 带有触摸事件的UIWebView_Iphone_Objective C_Ipad_Ios4 - Fatal编程技术网

Iphone 带有触摸事件的UIWebView

Iphone 带有触摸事件的UIWebView,iphone,objective-c,ipad,ios4,Iphone,Objective C,Ipad,Ios4,我需要能够捕捉UIWebView上的触摸事件,并且仍然能够使用webview的内容(html链接等) 我对UIWebView进行了子分类并实现了以下方法: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event; - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event; - (void)touchesMoved:(NSSet *)touches withE

我需要能够捕捉UIWebView上的触摸事件,并且仍然能够使用webview的内容(html链接等)

我对UIWebView进行了子分类并实现了以下方法:

- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event;
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
- (void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
我现在可以捕捉触摸事件,但该视图已变得不可用:(

然后,我尝试在UIViewController中的webview对象上设置以下内容,但没有任何改变

[webview setDelegate:self]; 
[webview setUserInteractionEnabled:YES];
有人能帮忙吗?你需要进一步的信息吗

蒂亚,
例如,在您实现的每个函数中,您是否也调用了super

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    // Your code here 
    [super touchesBegan:touches withEvent:event];
}

如果不调用超级UIWebView,我就无法知道有人触摸了它的链接

我最终没有对UIWebView进行子类化,并在视图控制器中的对象上使用手势识别器。它工作得非常好


S.

我确实给super打了电话,但网络视图仍然无法使用:(谢谢,这个问题与我的问题完全相同。真的很感谢我看到了你的帖子:),这是一个无用的日子,与这些事情斗争。非常感谢