项目介绍:
TTTTWaterFlow
This is a demo about waterFlow With UICollectionView
在适当的位置加上这个代码块, 返回值是item的高度, 这样就可以自动布局了
[Objective-C] 查看源文件 复制代码
[self.layout computeIndexCellHeightWithWidthBlock:^CGFloat(NSIndexPath *indexPath, CGFloat width) {
int randomNum = arc4random_uniform(200);
return (CGFloat)randomNum;
}];
DEMO 直接下载:
