阅读 157

邮箱、链接的样式和点击事件 1. 添加 RCAttributedDataSource 协议,设置at

邮箱、链接的样式和点击事件 1. 添加 RCAttributedDataSource 协议,设置at

【iOS开发】融云会话页面去掉电话号码、邮箱、链接的样式和点击事件

  1. 添加 RCAttributedDataSource 协议,设置attributeDataSource。

  2. 重置attributeDictionary。

  3. 重写点击回调。

// 去掉手机号、邮箱、超链接 高亮+点击事件
- (void)willDisplayMessageCell:(RCMessageBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath {
    if ([cell isKindOfClass:[RCTextMessageCell class]]) {
        RCTextMessageCell *txtCell = (RCTextMessageCell*)cell;
        txtCell.textLabel.attributeDictionary = nil;
        txtCell.textLabel.attributeDataSource = self;
    }
}

- (NSDictionary *)attributeDictionaryForTextType:(NSTextCheckingTypes)textType {
    return nil;
}

/*!
 点击Cell中电话号码的回调

 @param phoneNumber 点击的电话号码
 @param model       消息Cell的数据模型
 */
-(void)didTapPhoneNumberInMessageCell:(NSString *)phoneNumber model:(RCMessageModel *)model {

}
/*!
 点击Cell中URL的回调

 @param url   点击的URL
 @param model 消息Cell的数据模型
*/
- (void)didTapUrlInMessageCell:(NSString *)url model:(RCMessageModel *)model {

}

©著作权归作者所有:来自51CTO博客作者wx5fd70a028fc89的原创作品,如需转载,请注明出处,否则将追究法律责任


文章分类
后端
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐