CPYGridPagingLayout 0.3.3

CPYGridPagingLayout 0.3.3

测试已测试
Lang语言 Obj-CObjective C
许可证 MIT
发布上次发布2016年11月

cielpy 维护。



  • 作者
  • Cielpy

概述

CPYGridPagingLayout 是一个 UICollectionViewLayout 子类,用于以网格的形式显示项目。

功能

  • 支持水平和垂直布局
  • 自定义行数和列数
  • 自定义项目间距和行间距
  • 响应式 UI 支持,您可以在任何时间更改自定义选项
  • IBInspectable 支持

使用方法

    CPYGridPagingLayout *layout = [[CPYGridPagingLayout alloc] init];
    layout.numberOfColum = 5;
    layout.numberOfLine = 3;
    layout.itemSpacing = 10;
    layout.lineSpacing = 10;
    layout.direction = CPYGridPagingLayoutDirectionVertical;

    UICollectionView *collectionView = [[UICollectionView alloc] initWithFrame:CGRectZero collectionViewLayout:layout];
    collectionView.dataSource = self;
    collectionView.delegate = self;
    [self.view addSubview:collectionView];

//    you can use autolayout to layout the collection view here

//    and then you can change the layout's custom options if you need

安装

CPYGridPagingLayout 通过 CocoaPods 提供。要安装它,只需将以下行添加到您的 Podfile 中

pod "CPYGridPagingLayout"

然后按照官方指南配置您的项目。

联系方式

Cielpy, [email protected]

许可证

CPYGridPagingLayout 使用 MIT 许可证。有关更多信息,请参阅 LICENSE 文件。