YYText icon indicating copy to clipboard operation
YYText copied to clipboard

tableviewcell上使用YYlabel,添加高亮点击事件,点击事件不响应

Open RainyofSun opened this issue 8 years ago • 6 comments

首先很感谢您的这份开源库。功能很强大。使用的时候遇到了一个问题,希望您可以给解答一下。在tableview用YYLabel做了富文本处理和高亮点击事件,同时也在tableView上加了tap手势。点击YYLabel的时候,触发了tableview的点击事件,高亮点击没有作用,有什么解决方案嘛? 大大。将tableview的点击事件注释之后,YYLabel的高亮点击事件还是没有触发。求正确的食用方法。大大。 代码如下: if (modelSource.attMessage) { self.Binfo.attributedText = modelSource.attMessage; self.Binfo.textLayout = modelSource.textLayout; self.Binfo.size = modelSource.textLayout.textBoundingSize; } WS(weakSelf); [modelSource.attMessage yy_setTextHighlightRange:modelSource.receiveRange color:nil backgroundColor:nil tapAction:^(UIView * _Nonnull containerView, NSAttributedString * _Nonnull text, NSRange range, CGRect rect) { // [weakSelf receiverMessagePrivate:modelSource]; NSLog(@"kkkkkskk%@",text); }];

RainyofSun avatar May 24 '17 14:05 RainyofSun

请问你这个解决了吗?

Ucself avatar Jul 11 '17 02:07 Ucself

我是覆盖了一层手势在tableView上,导致此问题,已解决

Ucself avatar Oct 19 '17 12:10 Ucself

我也遇见过 不知道有撒好的方法可以解决的

guyuekk avatar Nov 07 '17 01:11 guyuekk

你肯定是在他上面一层view上加了其他手势

Ucself avatar Nov 07 '17 02:11 Ucself

http://events.jianshu.io/p/4ac26c5f887a

xxuqizhing avatar Feb 13 '23 09:02 xxuqizhing

上层view也没加手势啊

ghost avatar Oct 25 '23 07:10 ghost