测试已测试 | ✗ |
Lang语言 | Obj-CObjective C |
许可证 | MIT |
Released上次发布 | 2014年12月 |
由 Peter Stuart 维护。
EPSCollectionViewFormLayout
是 UICollectionViewLayout
的一个子类,使得在集合视图中布局表单,如登录和地址表单变得很容易。
有关如何使用 EPSCollectionViewFormLayout
的示例,请参阅 示例项目。
使用 EPSCollectionViewFormLayout
时,集合视图中的每个部分将在一行中布局。您的集合视图的 delegate
必须实现 EPSCollectionViewFormLayoutDelegate
协议中的两个方法
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout heightForSectionAtIndex:(NSInteger)section;
- (CGFloat)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout relativeWidthOfItemAtIndexPath:(NSIndexPath *)indexPath;
在 collectionView:layout:relativeWidthOfItemAtIndexPath:
返回的宽度是相对于集合视图的宽度,因此返回 0.5
将使在该 indexPath
的单元格宽度为集合视图宽度的一半。