问题:带有UIWebView的快速UITableViewCell
使用UITapGestureRecognizer实现UIWebView点击事件,但是当点击UIWebView中的链接时,将触发UITapGestureRecognizer和Link事件。如何解决?
cellForRowAtIndexPath代码:
UITapGestureRecognizer* singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap:)];
singleTap.numberOfTapsRequired = 1;
singleTap.numberOfTouchesRequired = 1;
singleTap.view.tag = indexPath.row;
singleTap.delegate = self;
singleTap.cancelsTouchesInView = NO;
[cell.wvContent addGestureRecognizer:singleTap]; // cell.wvContent is UIWebView
答案 0 :(得分:0)
不建议在uitableviewcell中使用webview。这两个类都是从scrollview继承的:)