你的位置:首页 > 软件开发 > 操作系统 > 自定义UICollectinviewFlowLayout,即实现瀑布流

自定义UICollectinviewFlowLayout,即实现瀑布流

发布时间:2016-02-13 23:00:14
如图所示,通过实现不规则的网格分布,来显示出不同的效果。因为集合视图必须要指定布局还可以显示,所以自定义布局就可以实现瀑布流的效果。//创建布局对象 WaterFlowLayout *flowLayout = [[WaterFlowLayout alloc] init]; ...

自定义UICollectinviewFlowLayout,即实现瀑布流

自定义UICollectinviewFlowLayout,即实现瀑布流

如图所示,通过实现不规则的网格分布,来显示出不同的效果。因为集合视图必须要指定布局还可以显示,所以自定义布局就可以实现瀑布流的效果。

//创建布局对象  WaterFlowLayout *flowLayout = [[WaterFlowLayout alloc] init];    flowLayout.delegate = self;  flowLayout.numberOfColumn = 3;    //创建集合视图  UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:[UIScreen mainScreen].bounds collectionViewLayout:flowLayout];

原标题:自定义UICollectinviewFlowLayout,即实现瀑布流

关键词:ie

ie
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。