UICollectionView委托方法不执行

2017-11-30  本文已影响0人  凡凡_c009

使用UICollectionView时,数据源有数据

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section

上面这个方法会执行,但是下面这个不执行

- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath

最后发现问题是初始化UICollectionView时,frame设置成了CGRectZero。

上一篇 下一篇

猜你喜欢

热点阅读