图片廊教程德precated教程、图片、precated

2023-09-06 16:32:12 作者:兄弟情,永恒在

我在本教程挣扎: http://developer.android.com/resources/tutorials/views/hello -gallery.html

它不会对API大于1.6的工作,我不能使它发挥作用。在R.styleable是pcated德$ P $

it wont work on API greater then 1.6, and i can't make it work. the "R.styleable" is deprecated

我将不胜感激,如果有人能提供一个图片库工作教程。

i would be grateful if anyone can provide a working tutorial for an image gallery.

谢谢!

推荐答案

不仅教程德precated,整个部件是因为果冻豆pcated德$ P $。

Not only the tutorial is deprecated, the whole widget is deprecated since Jelly Bean.

谷歌的建议:使用ViewPager或Horizo​​ntalScrollView来代替,而不要使用它像其他的ListView滚动意见。结论:帮助自己...:/

Google's suggestion: use ViewPager or HorizontalScrollView instead and don't use it other scroll views like ListView. Conclusion: Help yourself... :/

雪这是你的任务落实画廊的中心锁定刷卡行为和使用BaseAdapter至preLOAD并显示相邻的项目。像垂直滚动的意见水平画廊(经常在新闻应用中使用)一些UI模式是难以实现的。

SNow it's your task to implement the center-locked swipe behavior of the gallery and using a BaseAdapter to preload and show adjacent items. Some UI patterns like horizontal galleries in vertical scroll views (often used in news apps) are harder to implement.

与视图寻呼机的问题:它tooks父视图容器的整个高度,而忽略了它的高度的的孩子。因此很难在一个垂直滚动视图或列表视图项目布局的一个或多个视图寻呼机。

The problem with the view pager: it tooks the whole height of the parent view container and ignores the height's of it's children. So it's hard to layout one or more view pagers in a vertical scroll view or as a list view item.