0
問題:快速的UITableViewCell有一個UIWebView快速的UITableViewCell有一個UIWebView
使用UITapGestureRecognizer實現UIWebView的點擊事件,但是當在UIWebView中,UITapGestureRecognizer和鏈接事件點擊鏈接將被觸發。如何解決它
的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
點擊任何行會被重複多次觸發,該如何解決呢
爲了將來的參考,代碼應該包裝在代碼塊中。 – Brian