我想创建一个可以左右滑动的照片库。起初我看了一下 Gallery
,但它被标记为已弃用。
http://developer.android.com/reference/android/widget/Gallery.html
我们被告知尝试使用 ViewPager
。但是 PagerAdapter
类不会为我们处理 View 的回收(就像标准的 ListView
),对吗?
http://developer.android.com/reference/android/support/v4/view/PagerAdapter.html
是否要建立回收机制?
谢谢
最佳答案
But the PagerAdapter class doesn't handle recycling of views for us (like a standard ListView), does it?
不,我认为这是因为它是在假设您为每个页面使用不同布局的情况下构建的。
此外,由于它的滚动速度不如 ListView
(您不能“扔”ViewPager
来跳过多个页面),我认为它不会需要回收。
关于android - ViewPager + 回收 View ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11254701/