如何修改文本消息中的超链接的颜色
文章目录
示例代码:
-(void)willDisplayMessageCell:(RCMessageBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath {
if([cell isKindOfClass:[RCTextMessageCell class]]){
RCTextMessageCell *txtCell = (RCTextMessageCell *)cell;
txtCell.textLabel.attributeDictionary =
@{
@(NSTextCheckingTypeLink) : @{NSForegroundColorAttributeName : [UIColor redColor]},
@(NSTextCheckingTypePhoneNumber) : @{NSForegroundColorAttributeName : [UIColor redColor]}
};
txtCell.textLabel.highlightedAttributeDictionary =
@{
@(NSTextCheckingTypeLink) : @{NSForegroundColorAttributeName : [UIColor redColor]},
@(NSTextCheckingTypePhoneNumber) : @{NSForegroundColorAttributeName : [UIColor redColor]
};
}
}
详情查看:https://www.rongcloud.cn/?utm_source=SEO&utm_term=bokeyuan

评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论