卧式旋转木马或滚动型文字与图片上 [英] Horizontal Carousel or ScrollView with text over image
问题描述
我试图找出最佳的方式来设计于Android> = 2.1水平滚动视图有一些文字上的形象,当滚动如果达到最终它再次开始示出了第一项,因此旋转木马的行为。
I'm trying to figure out the best approach to design a horizontal scrollview from android >= 2.1 with some text over the image that when scroll if end is reached it starts showing the first items again hence carousel behavior.
您可以继续横向滚动,永远,并且第一个项目再一次显示了达到结束的时候,例如,当滚动滑动到左侧。它可以是一个适配器,旋转木马,但不是水平滚动型视图寻呼机,因为它不支持某些Android设备。
You can continue scrolling horizontally, forever, and the first item shows up again when the end is reached, for example when scrolling swiping to the left. It can be a view pager with an adapter, a carousel but not horizontal scrollview as it does not support some android device.
任何建议将不胜AP preciated。
Any suggestions would be greatly appreciated.
推荐答案
为什么不使用的 ViewPager ?由于它是在支持库使用。我会坚持使用,而不是HorizontalScrollView或画廊ViewPager。您可以检查为ViewPager例如从我的github 的。
Why not use a ViewPager? As it is available in the Support Library. I would insist to use ViewPager instead of HorizontalScrollView or Gallery. You can check an example for ViewPager from my github.
更新
要显示一个片段,您可以使用<一个内部的多个视图href=\"http://developer.android.com/reference/android/support/v4/view/PagerAdapter.html#getPageWidth%28int%29\"相对=nofollow> getPageWidth()。检查这里以供参考。
To show multiple views inside a Fragment you can use getPageWidth(). Check here for reference.
这篇关于卧式旋转木马或滚动型文字与图片上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!