1.由于我们的聊天界面不是全屏,所以每次进到聊天界面以后显示的都不是最新的内容
解决办法:让列表自动滚动到最下方
NSUInteger finalRow =MAX(0, [self.conversationMessageCollectionView numberOfItemsInSection:0] -1);
if (0 == finalRow) {
return;
}
NSIndexPath *finalIndexPath = [NSIndexPathindexPathForItem:finalRowinSection:0];
[self.conversationMessageCollectionView
scrollToItemAtIndexPath:finalIndexPath
atScrollPosition:UICollectionViewScrollPositionBottom
animated:NO];
if ([message.objectNameisEqualToString:@"RC:TxtMsg"]) {
groupCell.lastMessageLabel.text = message.content.conversationDigest;
}elseif ([message.objectNameisEqualToString:@"RC:ImgMsg"]) {
groupCell.lastMessageLabel.text =@"[图片]";
}elseif ([message.objectNameisEqualToString:@"RC:VcMsg"]) {
groupCell.lastMessageLabel.text =@"[语音]";
}elseif ([message.objectNameisEqualToString:@"RC:LBSMsg"]) {
groupCell.lastMessageLabel.text =@"[位置]";
}else {
groupCell.lastMessageLabel.text =@"[通知]";
}
删除指定位置的方法:
[self.chatSessionInputBarControl.pluginBoardView removeItemAtIndex:0];