Uje*_*esh 6 iphone ios uicollectionview custom-collection swift
我的目标是UICollectionView使用如下所示的布局创建一个.

这可能不创建自定义UICollectionViewLayout吗?
使用UICollectionViewDelegateFlowLayout方法。
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
let width : CGFloat
let height : CGFloat
if indexPath.item == 0 {
width = 100
height = 100
} else {
width = 50
height = 50
}
return CGSizeMake(width, height)
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6062 次 |
| 最近记录: |