Skip to content

Commit 313beca

Browse files
authored
Update README.md
1 parent b9dd753 commit 313beca

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

README.md

+17-12
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,25 @@
2525
下面是WSLWaterFlowLayout.h中的属性方法和代理方法,含义注释的还算清晰:
2626
```
2727
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; //样式
3334
3435
@class WSLWaterFlowLayout;
3536
3637
@protocol WSLWaterFlowLayoutDelegate <NSObject>
3738
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+
*/
4547
- (CGSize)waterFlowLayout:(WSLWaterFlowLayout *)waterFlowLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath;
4648
4749
/** 头视图Size */
@@ -80,6 +82,9 @@ typedef enum {
8082
_flow.flowLayoutStyle = WSLVerticalWaterFlow;
8183
```
8284
>更新于2018/8/12: 新增样式4-栅格布局样式的瀑布流,如下图
85+
简书地址:https://www.jianshu.com/p/f40bbe437265
86+
87+
8388

8489
![栅格布局样式](https://upload-images.jianshu.io/upload_images/1708447-baecc8e82b7c2eae.gif?imageMogr2/auto-orient/strip)
8590

0 commit comments

Comments
 (0)