UICollectController

 

//            [collectionView reloadItemsAtIndexPaths:@[sourceIndexPath]];// 只刷新个别item

            [collectionView reloadSections:[NSIndexSet indexSetWithIndex:sourceIndexPath.section]];// 刷新正给section

 

- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath;

注意返回的UICollectionReusableView上面的子视图,要设置自动伸缩。例如:_lb.autoresizingMask = UIViewAutoresizingFlexibleWidth;而设置

self.autoresizesSubviews = YES;不起作用

 

 

  • 九宫格 UICollectController

1.新建一个xib描述cell

2.注册xib

3.collectionView显示cell

*必须设置数据源(和代理并遵守协议) 

*实现数据源和代理的方法

 

layout n. 布局;设计;安排;陈列

dequeue vi. 出列

原文地址:https://www.cnblogs.com/dengchaojie/p/4743345.html