如何自定义会话列表

2025-04-30 03:32:04
推荐回答(1个)
回答1:

0. 可以对所有会话类型自定义cell 1.继承会话列表界面RCConversationListViewController; 2.重写-(NSMutableArray *)willReloadTableData:(NSMutableArray *)dataSource方法,modell类型必须设置为model.conversationModelType=RC_CONVERSATION_MODEL_TYPE_CUSTOMIZATION; 3.重写 //高度 -(CGFloat)rcConversationListTableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath //自定义cell -(RCConversationBaseCell *)rcConversationListTableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 4.重写收到消息处理,在方法里生成新的model,插入dataSouce,更新页面,注意model类型是RC_CONVERSATION_MODEL_TYPE_CUSTOMIZATION #pragma mark - 收到消息监听 -(void)didReceiveMessageNotification:(NSNotification *)notification 5. 参考demo中的RCDChatListViewController