带UIWebView的快速UITableViewCell?

时间:2013-05-21 16:36:33

标签: uitableview uiwebview

问题:带有UIWebView的快速UITableViewCell

  1. 使用UITapGestureRecognizer实现UIWebView点击事件,但是当点击UIWebView中的链接时,将触发UITapGestureRecognizer和Link事件。如何解决?

  2. 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
    
  3. 点击任意一行会多次重复触发,如何解决呢?

1 个答案:

答案 0 :(得分:0)

不建议在uitableviewcell中使用webview。这两个类都是从scrollview继承的:)