avoid overlapping chat cells

This commit is contained in:
Danmei Chen 2021-03-22 21:10:44 +01:00
parent 470e7add1f
commit 565ad48532

View file

@ -255,11 +255,11 @@ static const int BASIC_EVENT_LIST=15;
kCellId = NSStringFromClass(UIChatBubblePhotoCell.class);
else
kCellId = NSStringFromClass(UIChatBubbleTextCell.class);
// To use less memory and to avoid overlapping. To be improved.
UIChatBubbleTextCell *cell = [tableView dequeueReusableCellWithIdentifier:kCellId];
if (!cell) {
cell = [[NSClassFromString(kCellId) alloc] initWithIdentifier:kCellId];
}
cell = [[NSClassFromString(kCellId) alloc] initWithIdentifier:kCellId];
[cell setEvent:event];
if (chat) {
cell.isFirst = [self isFirstIndexInTableView:indexPath chat:chat];