Skip to content

一种瀑布流布局方式,用作collectionView的layout。

Notifications You must be signed in to change notification settings

runThor/HTWaterfallFlow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HTWaterfallFlow

一种瀑布流布局方式,用作collectionView的layout。

Show

example

Usage

// ViewController.m

#import "HTWaterfallFlowLayout.h"

HTWaterfallFlowLayout *waterfall = [[HTWaterfallFlowLayout alloc] initWithColumnCount:2];
[waterfall setColumnSpacing:10 rowSpacing:10 sectionInset:UIEdgeInsetsMake(10, 10, 10, 10)];
[waterfall setItemHeightBlock:^CGFloat(CGFloat itemWidth, NSIndexPath *indexPath) {
    // 返回计算后的高度
    return itemHeight;
}];

// 作为collectionView的layout
self.collectionView = [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:waterfall];
         

About

一种瀑布流布局方式,用作collectionView的layout。

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published