UICollectionview很好的东西,以前使用的时候,都没什么问题,最近使用的时候,当我设置了所有cell的attribute的时候,包括frame,发现collection view不滚动了,检查来检查去,包括使用代码让它滚动到某个cell的地方,都不滚动,检查了API,才发现一个坑货
- (CGSize)collectionViewContentSize; // Subclasses must override this method and use it to return the width and height of the collection view’s content. These values represent the width and height of all the content, not just the content that is currently visible. The collection view uses this information to configure its own content size to facilitate scrolling.
以前之所以没问题,设置了就可以了。