PDF 课件和源代码下载地址:
作者回复: 在课程中也实现了不同高度和宽度的简单样式。实现UICollectionViewDelegateFlowLayout中的- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath,根据indexpath返回对应的大小即可。如果使用自定义的layout,也可以在UICollectionViewLayout (UISubclassingHooks)中实现对应的函数,返回自定义的item attributes。
作者回复: UICollectionViewDelegateFlowLayout是继承自UICollectionViewDelegate,当我们设置了collectionView 的layout为UICollectionViewFlowLayout,设置collectionView的delegate就可以了哈