|
25 | 25 | 下面是WSLWaterFlowLayout.h中的属性方法和代理方法,含义注释的还算清晰:
|
26 | 26 | ```
|
27 | 27 | typedef enum {
|
28 |
| - WSLVerticalWaterFlow = 0, /** 竖向瀑布流 item等宽不等高 */ |
29 |
| - WSLHorizontalWaterFlow = 1, /** 水平瀑布流 item等高不等宽 不支持头脚视图*/ |
30 |
| - WSLVHWaterFlow = 2, /** 竖向瀑布流 item等高不等宽 */ |
31 |
| - WSLLineWaterFlow = 3 /** 线性布局 待完成,敬请期待 */ |
32 |
| -} WSLFlowLayoutStyle;//样式 |
| 28 | + WSLWaterFlowVerticalEqualWidth = 0, /** 竖向瀑布流 item等宽不等高 */ |
| 29 | + WSLWaterFlowHorizontalEqualHeight = 1, /** 水平瀑布流 item等高不等宽 不支持头脚视图*/ |
| 30 | + WSLWaterFlowVerticalEqualHeight = 2, /** 竖向瀑布流 item等高不等宽 */ |
| 31 | + WSLWaterFlowHorizontalGrid = 3, /** 特为国务院客户端原创栏目滑块样式定制-水平栅格布局 仅供学习交流*/ |
| 32 | + WSLLineWaterFlow = 4 /** 线性布局 待完成,敬请期待 */ |
| 33 | +} WSLFlowLayoutStyle; //样式 |
33 | 34 |
|
34 | 35 | @class WSLWaterFlowLayout;
|
35 | 36 |
|
36 | 37 | @protocol WSLWaterFlowLayoutDelegate <NSObject>
|
37 | 38 |
|
38 |
| -/** 竖向瀑布流 item等宽不等高 */ |
39 |
| --(CGFloat)waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout heightForItemAtIndexPath:(NSIndexPath *)indexPath itemWidth:(CGFloat)itemWidth; |
40 |
| -
|
41 |
| -/** 水平瀑布流 item等高不等宽 */ |
42 |
| --(CGFloat)waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout widthForItemAtIndexPath:(NSIndexPath *)indexPath itemHeight:(CGFloat)itemHeight; |
43 |
| -
|
44 |
| -/** 竖向瀑布流 item等高不等宽 列数、行数无用 */ |
| 39 | +/** |
| 40 | + 返回item的大小 |
| 41 | + 注意:根据当前的瀑布流样式需知的事项: |
| 42 | + 当样式为WSLWaterFlowVerticalEqualWidth 传入的size.width无效 ,所以可以是任意值,因为内部会根据样式自己计算布局 |
| 43 | + WSLWaterFlowHorizontalEqualHeight 传入的size.height无效 ,所以可以是任意值 ,因为内部会根据样式自己计算布局 |
| 44 | + WSLWaterFlowHorizontalGrid 传入的size宽高都有效, 此时返回列数、行数的代理方法无效, |
| 45 | + WSLWaterFlowVerticalEqualHeight 传入的size宽高都有效, 此时返回列数、行数的代理方法无效 |
| 46 | + */ |
45 | 47 | - (CGSize)waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
|
46 | 48 |
|
47 | 49 | /** 头视图Size */
|
@@ -80,6 +82,9 @@ typedef enum {
|
80 | 82 | _flow.flowLayoutStyle = WSLVerticalWaterFlow;
|
81 | 83 | ```
|
82 | 84 | >更新于2018/8/12: 新增样式4-栅格布局样式的瀑布流,如下图
|
| 85 | +简书地址:https://www.jianshu.com/p/f40bbe437265 |
| 86 | + |
| 87 | + |
83 | 88 |
|
84 | 89 | 
|
85 | 90 |
|
|
0 commit comments