融云吧 关注:126贴子:953
  • 0回复贴,共1

如何修改文本消息中的超链接的颜色

只看楼主收藏回复

示例代码:
- (void)willDisplayMessageCell:(RCMessageBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath {
if([cell isKindOfClass:[RCTextMessageCell class]]){
RCTextMessageCell *txtCell = (RCTextMessageCell *)cell;
txtCell.textLabel.attributeDictionary =
@璐村惂鐢ㄦ埛_053SAty馃惥
@(NSTextCheckingTypeLink) : @{NSForegroundColorAttributeName : [UIColor redColor]},
@(NSTextCheckingTypePhoneNumber) : @{NSForegroundColorAttributeName : [UIColor redColor]}
};
txtCell.textLabel.highlightedAttributeDictionary =
@{
@(NSTextCheckingTypeLink) : @{NSForegroundColorAttributeName : [UIColor redColor]},
@(NSTextCheckingTypePhoneNumber) : @{NSForegroundColorAttributeName : [UIColor redColor]
};
}
}


IP属地:北京1楼2023-12-27 12:36回复