当前位置: 代码迷 >> 综合 >> IOS UITableView 移除cell上之前的视图
  详细解决方案

IOS UITableView 移除cell上之前的视图

热度:22   发布时间:2023-12-15 01:40:23.0


UITableView reload使用时需要先移除cell上所有的视图,再去加载新的UI到Cell上。

下面是移除cell上的UI方法:

- (void)tableView:(UITableView*)tableView willDisplayCell:(UITableViewCell*)cell
forRowAtIndexPath:(NSIndexPath*)indexPath
{for (UIView* subView in cell.contentView.subviews) {[subView removeFromSuperview];}


  相关解决方案