WXHWaterFlow

WXHWaterFlow

使用UICollectioView编写,调用简洁,注解最为详细的瀑布流

  • 设置每个item的高
- (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

你可能感兴趣的:(WXHWaterFlow)