4个collectionview分别显示抽奖信息,4个数据源,个数分别为(9,9,7,5),最后结果是只是显示5个,数据源正常。

尝试1、- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath

中将collection进行分开判断,分开注册

尝试2、分开判断了所有返回的数据源的个数,在-(NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section

中写死个数还是返回5个

后来在stackoverflow中搜索到答案http://stackoverflow.com/questions/19443204/assertion-failure-in-uicollectionviewdata-validatelayoutinrect-on-ios7

 

开始自以为4个collectionview所用的布局一样,用同一个就可以。但是最后悲剧的发现,4个collectionview必须用4个UICOllectionViewFlowLayout

 

posted on 2016-01-28 11:00  火星的蝈蝈  阅读(438)  评论(0编辑  收藏  举报