UICollectionView具有无限滚动? [英] UICollectionView with infinite scrolling?
问题描述
我正在尝试使用无限滚动行为实现集合视图。滚动应该是圆形的 - 就像在 UIPickerView
中一样。可以用Apple的 UICollectionView
来完成,或者别无选择,只能创建一个水平的PickerView?
I'm attempting to implement a collection view with an infinite scrolling behaviour. The scrolling should be circular - like in a UIPickerView
. Can it be done with Apple's UICollectionView
or there is no choice but to create a horizontal PickerView ?
你是做什么的?想想?
推荐答案
您应该观看WWDC 2011会话视频高级ScrollView技术,他们谈论无限滚动,我'我非常确定可以在 UICollectionView
s中使用它。它会在您滚动时重新定位,并将新项目放在当前可见项目之后(或之前,具体取决于滚动方向)。
You should watch the WWDC 2011 session video "Advanced ScrollView Techniques", they talk about infinite scrolling, and I'm pretty sure it's possible to use that with UICollectionView
s. It recenters while you scroll, and places the new items after the current visible items (or before, depending on the scroll direction).
就像他们在会话中所说的那样, 不应该使用具有结尾的方法。就像会议中所述:人们肯定会在某一点找到优势。
Like they say in the session, you should not use an approach that has an ending. Like stated in the session: People will definitely find the edge at one point.
这篇关于UICollectionView具有无限滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!