立即注册 登录
即时通讯网 返回首页

Ryun的个人空间 http://www.52im.net/?28523 [收藏] [复制] [RSS]

日志

自定义聊天界面头像

已有 3714 次阅读2023-07-06 19:24 |个人分类:IM知识

"在聊天界面(继承RCConversationViewController的ViewController)里,实现下面的方法

- (void)willDisplayConversationTableCell:(RCMessageBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath
{
    if ([cell isKindOfClass:[RCMessageCell class]]) {
        RCMessageCell *messageCell = (RCMessageCell *)cell;
        //messageCell.portraitImageView
        UIImageView *portraitImageView= (UIImageView *)messageCell.portraitImageView;
        portraitImageView.layer.cornerRadius = 10;
    }
}
在方法里判断如果 cell 是 RCMessageCell,就将 cell 强制转换成 RCMessageCell,然后找到 cell 的 portraitImageView 属性,再强制转换为UIImageView,这样就可以设置圆角的半径了。(来源参考:https://www.rongcloud.cn/?utm_source=SEO)"

0 推荐

评论 (0 个评论)

facelist

您需要登录后才可以评论 登录 | 立即注册

返回顶部