【发布时间】:2017-08-23 07:23:19
【问题描述】:
任何人都可以回答一些示例代码以将 uicollectionview 垂直设置到底部。
dispatch_async(dispatch_get_main_queue(), ^{
[self.clViewImages reloadData];
scrolling collection view to bottom
NSInteger section = [self numberOfSectionsInCollectionView:self.clViewImages] - 1;
NSInteger item = [self collectionView:self.clViewImages numberOfItemsInSection:section] - 1;
NSIndexPath *lastIndexPath = [NSIndexPath indexPathForItem:item inSection:section];
[self.clViewImages scrollToItemAtIndexPath:lastIndexPath atScrollPosition:UICollectionViewScrollPositionBottom animated:YES];
});
这会非常快速地滚动我的收藏视图。我想明智地软动画部分。 帮我看看。
提前致谢
【问题讨论】:
-
您可以一次性滚动收藏视图中的所有项目,这就是它快速的原因。因此,您可以一次滚动到屏幕上可见的 n 个项目(4-5 个项目),然后滚动到下一个 n 项目,依此类推。这样我们就平滑了。
-
好的 @RahulKumar 让我这样做
标签: ios cocoa-touch animation uicollectionview