KTCenterFlowLayout
所属分类:iPhone/iOS
开发工具:Objective-C
文件大小:0KB
下载次数:0
上传日期:2021-04-27 10:26:32
上 传 者:
sh-1993
说明: 将集合视图单元格与屏幕中心对齐。
(Aligns collection view cells to the center of the screen.)
文件列表:
CHANGELOG.md (798, 2016-12-21)
Example/ (0, 2016-12-21)
Example/CenterFlow.xcodeproj/ (0, 2016-12-21)
Example/CenterFlow.xcodeproj/project.pbxproj (18714, 2016-12-21)
Example/CenterFlow.xcodeproj/project.xcworkspace/ (0, 2016-12-21)
Example/CenterFlow.xcodeproj/project.xcworkspace/contents.xcworkspacedata (155, 2016-12-21)
Example/CenterFlow/ (0, 2016-12-21)
Example/CenterFlow/Constants.h (365, 2016-12-21)
Example/CenterFlow/Constants.m (1389, 2016-12-21)
Example/CenterFlow/Default-568h@2x.png (12767, 2016-12-21)
Example/CenterFlow/Images.xcassets/ (0, 2016-12-21)
Example/CenterFlow/Images.xcassets/AppIcon.appiconset/ (0, 2016-12-21)
Example/CenterFlow/Images.xcassets/AppIcon.appiconset/Contents.json (585, 2016-12-21)
Example/CenterFlow/Info.plist (1219, 2016-12-21)
Example/CenterFlow/KTAppDelegate.h (280, 2016-12-21)
Example/CenterFlow/KTAppDelegate.m (3587, 2016-12-21)
Example/CenterFlow/KTAwesomeCell.h (249, 2016-12-21)
Example/CenterFlow/KTAwesomeCell.m (1401, 2016-12-21)
Example/CenterFlow/KTAwesomeSizingCell.h (261, 2016-12-21)
Example/CenterFlow/KTAwesomeSizingCell.m (1344, 2016-12-21)
Example/CenterFlow/KTBasicCollectionViewController.h (349, 2016-12-21)
Example/CenterFlow/KTBasicCollectionViewController.m (3692, 2016-12-21)
Example/CenterFlow/KTHeaderFooterView.h (339, 2016-12-21)
Example/CenterFlow/KTHeaderFooterView.m (1155, 2016-12-21)
Example/CenterFlow/KTSelfSizingCollectionViewController.h (267, 2016-12-21)
Example/CenterFlow/KTSelfSizingCollectionViewController.m (1928, 2016-12-21)
Example/CenterFlow/KTVariableHeightCollectionViewController.h (323, 2016-12-21)
Example/CenterFlow/KTVariableHeightCollectionViewController.m (1733, 2016-12-21)
Example/CenterFlow/Launch.storyboard (2797, 2016-12-21)
Example/CenterFlow/main.m (334, 2016-12-21)
Example/CenterFlow/tabbar-image.png (115, 2016-12-21)
Example/CenterFlow/tabbar-image@2x.png (160, 2016-12-21)
Example/CenterFlow/tabbar-image@3x.png (239, 2016-12-21)
KTCenterFlowLayout.h (278, 2016-12-21)
KTCenterFlowLayout.m (6748, 2016-12-21)
KTCenterFlowLayout.podspec (663, 2016-12-21)
LICENSE (1072, 2016-12-21)
example.png (123510, 2016-12-21)
... ...
# KTCenterFlowLayout
[![CocoaPods](https://img.shields.io/cocoapods/v/KTCenterFlowLayout.svg)]()
KTCenterFlowLayout is a subclass of UICollectionViewFlowLayout which Aligns cells to the center of a collection view. It effectively enforces the `minimumInteritemSpacing`.
### Usage
```ruby
# In your Podfile
pod 'KTCenterFlowLayout'
```
Objective-C:
```objective-c
KTCenterFlowLayout *layout = [KTCenterFlowLayout new];
layout.minimumInteritemSpacing = 10.f;
layout.minimumLineSpacing = 10.f;
[[UICollectionViewController alloc] initWithCollectionViewLayout:layout];
```
Swift:
```swift
let layout = KTCenterFlowLayout()
layout.minimumInteritemSpacing = 10.0
layout.minimumLineSpacing = 10.0
UICollectionViewController(collectionViewLayout: layout)
```
### Example
See the layout in use in the `./Example` app:
### Horizontal Scrolling
This layout **doesn't** work with `UICollectionViewScrollDirection.horizontal`.
### Self-sizing cells
This layout **doesn't** work with self-sizing collection view cells (`estimatedItemSize`). Of course, neither does the vanilla `UICollectionViewFlowLayout`. Pull requests appreciated from anybody interested in solving self-sizing layouts!
近期下载者:
相关文件:
收藏者: