We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题! 按照示例中的代码,延时10秒后重新设置self.components;TableComponent能够很好的解决cell的缓存,而collectionComonent没有缓存;通过涂层可以看到有很多的collection叠加在一起了
The text was updated successfully, but these errors were encountered:
- (__kindof UITableViewCell *)cellForTableView:(UITableView *)tableView atIndexPath:(NSIndexPath *)indexPath{ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:self.cellIdentifier forIndexPath:indexPath]; self.collectionView.frame = [self collectionViewRectForBounds:cell.bounds]; [cell.contentView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)]; [cell.contentView addSubview:self.collectionView]; return cell; }
在cell的contentView中删除已有的collectionView
Sorry, something went wrong.
自定义一个 cell 子类:
@interface MyCell : UITableViewCell <UICollectionViewDatasource, UICollectionViewDelegate> @property (strong) UICollectionView *collectionView; @end @implementation MyCell - (void)prepareForReuse { [super prepareForReuse]; [self.collectionView reloadData]; } @end
这些事情交给 cell 自己做,在 prepareForReuse 中
prepareForReuse
No branches or pull requests
如题!
按照示例中的代码,延时10秒后重新设置self.components;TableComponent能够很好的解决cell的缓存,而collectionComonent没有缓存;通过涂层可以看到有很多的collection叠加在一起了
The text was updated successfully, but these errors were encountered: