【发布时间】:2014-10-01 19:46:42
【问题描述】:
我想滚动到集合视图的页脚或页眉视图,但是,scrollToItemAtIndexPath 的标准方法仅滚动到单元格
- (void)scrollToBottom {
NSInteger section = [self numberOfSectionsInCollectionView:self.collectionView] - 1;
NSInteger item = [self collectionView:self.collectionView numberOfItemsInSection:section] - 1;
if ((section > 0) && (item > 0)) {
NSIndexPath * lastIndexPath = [NSIndexPath indexPathForItem:item inSection:section];
[self.collectionView scrollToItemAtIndexPath:lastIndexPath atScrollPosition:UICollectionViewScrollPositionBottom animated:NO];
}
}
如何滚动到任何页脚、页眉视图,类似于滚动到单元格?
【问题讨论】:
标签: ios objective-c cocoa-touch uicollectionview