She*_*101 5 objective-c uiscrollview ios uicollectionview
我有一个UICollectionView.我想在视图出现时滚动到底部.这该怎么做?
有人可以帮我解决这个问题吗?提前致谢.
您可以使用以下代码以UICollectionView编程方式滚动到底部
NSInteger section = [self numberOfSectionsInCollectionView:collectionView] - 1;
NSInteger item = [self collectionView:collectionView numberOfItemsInSection:section] - 1;
NSIndexPath *lastIndexPath = [NSIndexPath indexPathForItem:item inSection:section];
[collectionView scrollToItemAtIndexPath:lastIndexPath atScrollPosition:UICollectionViewScrollPositionBottom animated:YES];
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4608 次 |
| 最近记录: |