相關概念:
1.需要一個layout(布局的樣式)
2.初始化collectionView 同時需要 注冊cellID 一定要與建立cell的地方是同一個cellID
與tableView一樣 UICollectionViewDataSource,UICollectionViewDelegate
也有兩個必須實作的方法
1.每組裡面有多上行(item)
2.初始化cell的方法
設定行高,如果大小一樣 可以在UICollectionViewFlowLayout方法裡面去設定
如果個體有差別 可以在 UICollectionViewDelegateFlowLayout 去設定
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath