3

I have an UICollectionView where the items can modify at run time it's height. The problem is that when an item is higher than another, the item are surrounded by a lot o blank space.

enter image description here

I'm looking for a property that create this:

enter image description here

and I want use UICollectionView not github example or third part implementation. Thanks.

4

1 回答 1

1

我不相信会有UICollectionViewFlowLayout这种行为。在修改高度或为该单元格返回不同的值后尝试重新加载您的集合视图,collectionView:layout:sizeForItemAtIndexPath:并查看间隙是否填充。否则,我建议使用自定义UICollectionViewLayout子类。

此类可能适合此目的 - UICollectionViewLayout 子类与您的集合视图一起使用: https ://github.com/aceisScope/WaterflowView/blob/master/WaterFlowDisplay/WaterFlowLayout.h

于 2013-07-01T15:31:15.753 回答