Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ONECATYU/WSCollectionViewFlowLayout
可替代UICollectionViewFlowLayout的标签流布局,支持固定有规则的布局形式.实现了UICollectionViewDelegateFlowLayout协议方法.使用形式和系统Flowlayout相同.
https://github.com/ONECATYU/WSCollectionViewFlowLayout
Last synced: 21 days ago
JSON representation
可替代UICollectionViewFlowLayout的标签流布局,支持固定有规则的布局形式.实现了UICollectionViewDelegateFlowLayout协议方法.使用形式和系统Flowlayout相同.
- Host: GitHub
- URL: https://github.com/ONECATYU/WSCollectionViewFlowLayout
- Owner: ONECATYU
- License: mit
- Created: 2017-06-10T01:35:46.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-24T04:01:13.000Z (over 7 years ago)
- Last Synced: 2024-10-31T16:28:55.591Z (about 1 month ago)
- Language: Objective-C
- Size: 1.62 MB
- Stars: 5
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - WSCollectionViewFlowLayout - 可替代UICollectionViewFlowLayout的标签流布局,支持固定有规则的布局形式。实现了UICollectionViewDelegateFlowLayout协议方法。使用形式和系统Flowlayout相同。【 [Priview](https://github.com/ONECATYU/WSCollectionViewFlowLayout/raw/master/Demo.gif) 】 (OOM-Leaks-Crash / FlowLayout)
README
### WSCollectionViewFlowLayout
* 实现了UICollectionViewDelegateFlowLayout协议方法.使用形式和系统Flowlayout相同.
* 支持多个section, 不同section标签流布局和固定有规则布局混合#### 使用
* 您可以通过实现UICollectionViewDelegateFlowLayout协议方法,来设置cell/header/footer.
* 也可以通过下面这种方式来设置
```objective-c
WSCollectionViewFlowLayout *layout = [[WSCollectionViewFlowLayout alloc]init];
layout.contentInset = UIEdgeInsetsMake(20, 8, 20, 8);
layout.minimumLineSpacing = 8;
layout.minimumInteritemSpacing = 8;
layout.sectionInset = UIEdgeInsetsMake(8, 8, 8, 8);
layout.itemSize = CGSizeMake(100, 100);
layout.headerReferenceSize = CGSizeMake(CGRectGetWidth(self.view.frame) - 16, 40);
layout.footerReferenceSize = CGSizeMake(CGRectGetWidth(self.view.frame) - 16, 40);UICollectionView *collectionView = [[UICollectionView alloc]initWithFrame:self.view.bounds collectionViewLayout:layout];
collectionView.delegate = self;
collectionView.dataSource = self;
collectionView.backgroundColor = [UIColor whiteColor];
[self.view addSubview:collectionView];
```