YBAttributeTextTapAction icon indicating copy to clipboard operation
YBAttributeTextTapAction copied to clipboard

展开点击无效果

Open Mr-WaterMelon-China opened this issue 5 years ago • 2 comments

你好,下载了你的demo运行,如果我首先设置label的行数,再点击展开就无效果, 这是为什么呢?在demo的第0组我是这样设置的 cell.testTapLabel.numberOfLines = 2; cell.testTapLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; 然后展开就无响应了

Mr-WaterMelon-China avatar Apr 30 '19 08:04 Mr-WaterMelon-China

文本必须全部显示完才能准确响应事件,这种大范围缺省的,省略号后的文字不可能计算出来坐标的

lyb5834 avatar May 15 '19 13:05 lyb5834

经测试,需要为所有字符串加上富文本属性,不能仅设置事件文本而忽略其他文本的设置。

    [allText addAttributes:@{
            NSFontAttributeName: [UIFont systemFontOfSize:12.f],
            NSForegroundColorAttributeName: UIColor.textColor97
    } range:normalRange];
    [allText addAttributes:@{
            NSForegroundColorAttributeName: UIColor.themColor,
            NSFontAttributeName: [UIFont systemFontOfSize:12.f],
            NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle)
    } range:viewDetailRange];

ZihenMo avatar Dec 23 '20 09:12 ZihenMo