项目作者: cielpy

项目描述 :
A UICollectionViewLayout subclass used to show items like a grid.
高级语言: Objective-C
项目地址: git://github.com/cielpy/CPYGridPagingLayout.git
创建时间: 2016-11-10T16:34:14Z
项目社区:https://github.com/cielpy/CPYGridPagingLayout

开源协议:MIT License

下载


CPYGridPagingLayout

CI Status
Version
License
Platform

Overview

CPYGridPagingLayout is a UICollectionViewLayout subclass used to show items like a grid.

Features

  • Both horizontal and vertical layout support
  • Customized number of line and colum
  • Customized item spacing and line spacing
  • Responsive UI support, you can change custom options anytime
  • IBInspectable support

Usage

  1. CPYGridPagingLayout *layout = [[CPYGridPagingLayout alloc] init];
  2. layout.numberOfColum = 5;
  3. layout.numberOfLine = 3;
  4. layout.itemSpacing = 10;
  5. layout.lineSpacing = 10;
  6. layout.direction = CPYGridPagingLayoutDirectionVertical;
  7. UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
  8. collectionView.dataSource = self;
  9. collectionView.delegate = self;
  10. [self.view addSubview:collectionView];
  11. // you can use autolayout to layout the collection view here
  12. // and then you can change the layout's custom options if you need

Installation

CPYGridPagingLayout is available through CocoaPods. To install
it, simply add the following line to your Podfile:

  1. pod "CPYGridPagingLayout"

You can install CPYGridPagingLayout with Carthage too, just write this line to your Cartfile:

  1. github "cielpy/CPYGridPagingLayout"

then follow the official tutorial to config your project.

Contact

Cielpy, beijiu572@gmail.com

License

CPYGridPagingLayout is available under the MIT license. See the LICENSE file for more info.