显示线性布局的水平滚动视图。
我想创建带有文本描述和按钮的图像的水平滚动视图。
列表中的每个条目将占据整个屏幕,左侧有一张图片,右侧有一些描述性文本。向左或向右滚动会将整个视图移动一个屏幕并显示下一张图片和文本。
显示此类数据的最佳方式是什么?
谢谢, 中号
I would like to create a horizontally scrolling view of an image with text description and a button.
Each entry in the list will take up the entire screen with a picture on the left and some descriptive text to the right of that. Scrolling left or right will move the entire view one screen along and display the next picture and text.
What is the best way to display such data?
Thanks,
M
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你可能需要查看android的ViewFlipper。
You may need to check out the ViewFlipper of android.
我认为您正在寻找可以水平而不是垂直探索的列表视图。
所以你可以看看 水平列表视图代码 当然你可以使用这种类型的画廊的观点....
希望这可以帮助你...
祝您编码愉快。
I think you are in search of listview which can be explored horizontally rather than vertically.
so you can take a look at horizontal listview code of course you can use gallery for this type of view....
Hope this may help you...
Have a Happy coding.
好的,这是一种实现我想做的事情的方法。我最初是从 http://geekyouup.blogspot.com/ 获取的2011/07/viewpager-example-from-paug.html 但我想向滚动列表添加多个textView。
一开始我很难包含多个文本视图
该站点的演示中显示了这一点,但这是因为在 destroyItem 和 initemfromObject 方法中强制转换为 TextView。我将为 sqlite 编写一个 PagerCurrsor 适配器,因此当我让它工作时我会将其发布在这里。
另一件需要注意的事情是,当用户滑动列表时,位置会递增,因此您可以使用它来迭代数组或光标。
希望这对其他开发人员有帮助,并感谢您发布的所有答案。
覆盖方法:
XML:
[1]http://geekyouup.blogspot.com/2011/07/viewpager-example-from-paug.html
OK, here is a way to implement what I was looking to do. I initially took this from http://geekyouup.blogspot.com/2011/07/viewpager-example-from-paug.html but I wanted to add more than one textView to the scrolling list.
I was struggling at first to include more than the one text view
which is shown in the demo at this site but it was because of then Casting to TextView in the destroyItem and initemfromObject methods. I'm going to be writing a PagerCurrsor adapter for sqlite so I'll post it here when I get it working.
Another thing to note is that position is incremented as the user swipes through the list so you would use that to iterate through an array or a cursor.
Hope this helps other developers and thanks for all the answers posted.
Overidden methods:
XML:
[1]http://geekyouup.blogspot.com/2011/07/viewpager-example-from-paug.html