WXHWaterFlow
使用UICollectioView编写,调用简洁,注解最为详细的瀑布流
- (CGFloat)waterflowLayout:(WXHWaterFlowLayout *)waterflowLayout heightForItemAtIndex:(NSUInteger)index itemWidth:(CGFloat)itemWidth{ WXHShop *shop = self.shops[index]; // 等比例缩放 return itemWidth * shop.h / shop.w;}
- (CGFloat)rowMarginInWaterflowLayout:(WXHWaterFlowLayout *)waterflowLayout{ return 10;}
- (CGFloat)columnCountInWaterflowLayout:(WXHWaterFlowLayout *)waterflowLayout{ // 模拟数据过多 if (self.shops.count <= 50) return 2; return 3;}
- (UIEdgeInsets)edgeInsetsInWaterflowLayout:(WXHWaterFlowLayout *)waterflowLayout{ return UIEdgeInsetsMake(10, 10, 30, 10);}
github地址:https://github.com/nemo316/WXHStatusHUD