PHPz2017-04-18 09:33:15
Are you asking about the layout?
The layout of UICollectionView is simple
You use the Command key to open the DataSource of UICollectionView
There are various methods to set various parameters.
A few are listed below. The first two public methods are required and optional are optional
public protocol UICollectionViewDataSource : NSObjectProtocol {
@available(iOS 6.0, *) //一个Section中有多少个单元格
public func collectionView(collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int
@available(iOS 6.0, *) //返回 单元格,你可以给单元格里放个image
public func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell
@available(iOS 6.0, *) //有几个 Section (可选,没有此方法,默认是1个)
optional public func numberOfSectionsInCollectionView(collectionView: UICollectionView) -> Int
/*
dequeueReusableSupplementaryViewOfKind:withReuseIdentifier:forIndexPath:
*/