我试图在TableView Cell中获取collectionView时遇到了类似的问题。
如果您要更改单元格的模型,则应告诉该单元格重新计算其布局,以便该单元格更改其大小并调用layoutIfNeeded
。
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView
cellForItemAtIndexPath:(NSIndexPath *)indexPath
UICollectionViewCell*cell = ...
// Do your stuff here to configure the cell
// Tell the cell to redraw its contentView
[cell layoutIfNeeded];
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句