ios9 - iOS客户端 淘宝 的个人主页布局
大家讲道理
大家讲道理 2017-04-18 09:31:15
0
1
326

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

Antworte allen(1)
PHPzhong

你问的是布局吗?

UICollectionView的布局 就简单了
你用Commond键点开UICollectionView的 DataSource
里面有各种方法设置各种参数,
下面列入几个,前两个 public 方法为必须有 , 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:
*/

Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage