Latest 0.0.1
Homepage https://github.com/wutongyu008/MQWaterFlow
License MIT
Platforms ios 7.0, requires ARC
Dependencies MJExtension, SDWebImage, MJRefresh
Frameworks Foundation, CoreGraphics, UIKit
Authors

用UICollectionViewLayout自定义各种流式布局,实现图片的不规则排列

垂直滚动:Vertical Scroll

MQWaterFlow

具体使用将对应的Layout文件拖拽到项目中

样式一

MQWaterFlow

1.导入头文件MQWaterFlowLayout.h

2.遵守协议

@interface MQWaterFlowController ()<MQWaterFlowLayoutDelegate>

3.设置代理

    // 设置collectionView
    MQWaterFlowLayout *layout = [[MQWaterFlowLayout alloc]init];
    layout.delegate = self;

4.实现方法

@required
/// 返回indexPath位置cell的高度
- (CGFloat)waterFlowLayout:(MQWaterFlowLayout *)flowLayout HeightForItemAtIndexPath:(NSIndexPath *)indexPath withItemWidth:(CGFloat)width;

@optional
/// 返回显示列数
- (NSInteger)columnCountInWaterFlowLayout:(MQWaterFlowLayout *)flowLayout;
/// 返回行间距
- (CGFloat)rowMarginInWaterFlowLayout:(MQWaterFlowLayout *)flowLayout;
/// 返回列间距
- (CGFloat)columnMarginInWaterFlowLayout:(MQWaterFlowLayout *)flowLayout;
/// 返回内边距
- (UIEdgeInsets)edgeInsetsInWaterFlowLayout:(MQWaterFlowLayout *)flowLayout;

当不实现列数、行间距、列间距、内边距的代理方法时,会采用默认值

样式二

MQWaterFlow

1.导入头文件MQGridFlowLayout.h

2.遵守协议

@interface MQGridFlowController ()<MQGridFlowLayoutDelegate>

3.设置代理

// 设置collectionView
    MQGridFlowLayout *layout = [[MQGridFlowLayout alloc]init];
    layout.delegate = self;

4.实现方法

@optional
/// 返回行间距
- (CGFloat)rowMarginInWaterFlowLayout:(MQGridFlowLayout *)flowLayout;
/// 返回列间距
- (CGFloat)columnMarginInWaterFlowLayout:(MQGridFlowLayout *)flowLayout;
/// 返回内边距
- (UIEdgeInsets)edgeInsetsInWaterFlowLayout:(MQGridFlowLayout *)flowLayout;

当不实现行间距、列间距、内边距的代理方法时,会采用默认值

样式三

MQWaterFlow

1.导入头文件MQWaterFlowLayout.h

2.遵守协议

@interface MQWaterFlowController ()<MQWaterFlowLayoutDelegate>

3.设置代理

    // 设置collectionView
    MQWaterFlowLayout *layout = [[MQWaterFlowLayout alloc]init];
    layout.delegate = self;

4.实现方法

@optional
/// 返回行间距
- (CGFloat)rowMarginInWaterFlowLayout:(MQPhotoWallLayout *)flowLayout;
/// 返回列间距
- (CGFloat)columnMarginInWaterFlowLayout:(MQPhotoWallLayout *)flowLayout;
/// 返回内边距
- (UIEdgeInsets)edgeInsetsInWaterFlowLayout:(MQPhotoWallLayout *)flowLayout;

当不实现行间距、列间距、内边距的代理方法时,会采用默认值

Latest podspec

{
    "name": "MQWaterFlow",
    "version": "0.0.1",
    "license": "MIT",
    "summary": "u5c01u88c5u7684u5404u79cdu6d41u5f0fu5e03u5c40",
    "homepage": "https://github.com/wutongyu008/MQWaterFlow",
    "authors": {
        "u68a7u6850u96e808": "[email protected]"
    },
    "source": {
        "git": "https://github.com/wutongyu008/MQWaterFlow.git",
        "tag": "0.0.1"
    },
    "requires_arc": true,
    "description": "Fast encryption string, the current support for MD5 (16, 32), Sha1, Base64",
    "source_files": [
        "MQWaterFlow",
        "MQWaterFlow/**/*.{h,m}"
    ],
    "platforms": {
        "ios": "7.0"
    },
    "frameworks": [
        "Foundation",
        "CoreGraphics",
        "UIKit"
    ],
    "dependencies": {
        "MJExtension": [
            "3.0.9"
        ],
        "SDWebImage": [
            "3.7.4"
        ],
        "MJRefresh": [
            "3.1.0"
        ]
    }
}

Pin It on Pinterest

Share This