自定义融云会话列表 cell 选中背景
项目用的融云,IMKit SDK(自带 UI),但是在使用会话列表的时候,cell 选中和长按的时候默认是灰色的。设计说需要改啊,那就研究一下如何修改吧。废话不多说,直接继承 RCConversationListViewController,然后重写以下方法
1.以下代码是去掉选中颜色的
- (void)willDisplayConversationTableCell:(RCConversationBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath { cell.selectionStyle = UITableViewCellSelectionStyleNone; }
2.以下代码是重写颜色的,想配啥色请随意
- (void)willDisplayConversationTableCell:(RCConversationBaseCell *)cell atIndexPath:(NSIndexPath *)indexPath { UIView *backView = [[UIView alloc] init]; backView.backgroundColor = [UIColor redColor]; cell.selectedBackgroundView = backView; }
SDK 开放出来的 .h 类对方法注释写的很详细,建议大家多看一下,这样可以快速集成,少走弯路。也是培养集成第三方库的好习惯。融云(www.rongcloud.cn)