
在使用UICollectionView碰到的诡异问题,求解答
1个回答
展开全部
重用机制,生成的最多cell个数基本上就是等于你的最大屏幕行数+1
那么你的 [cell initCustomItemView] 方法就不应该放在cell 的init 或者initWithFrame里
可以作为一个单独的方法提出来,在
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
里调用
那么你的 [cell initCustomItemView] 方法就不应该放在cell 的init 或者initWithFrame里
可以作为一个单独的方法提出来,在
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
里调用
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询