码迷,mamicode.com
首页 > 移动开发 > 详细

iOS9UICollectionView自定义布局modifying attributes returned by UICollectionViewFlowLayout without copying them

时间:2016-01-05 12:44:35      阅读:243      评论:0      收藏:0      [点我收藏+]

标签:

UICollectionViewFlowLayout has cached frame mismatch

 

This is likely occurring because the flow layout subclass MyLineLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them

 

- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect

NSArray *original = [super layoutAttributesForElementsInRect:rect];

NSArray *array = [[NSArray alloc] initWithArray:original copyItems:YES];

对array进行修改就可以了,不要对original修改

这样就不会报这个警告了

iOS9UICollectionView自定义布局modifying attributes returned by UICollectionViewFlowLayout without copying them

标签:

原文地址:http://www.cnblogs.com/damiao/p/5101725.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!