Android 中的 Horizontol 滚动视图
我想在 Android 中创建 Horizontol 滚动视图。该视图将是水平滚动的图像和文本的组合,我应该能够动态修改滚动器中的内容(文本和图像)
有什么想法吗?
I want to create a Horizontol Scrolling View in Android. The view would be a combination of images and text scrolling horizontally and I should be able to dynamically modify the content(text and images) in the Scroller
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在滚动视图中添加 HorizontalScrollView 它将在两个方向上滚动。
add HorizontalScroolView in the scrollview it will scroll in both directions.
您也许还可以查看 Gallery 元素。
You could perhaps also have a look at the Gallery element.
您想要类似 ListView 的东西,但处于水平方向。
我会让它扩展 AbsListView,它是用来显示动态的列表。
理想情况下,如果您复制 ListView 源并将其切换到水平模式,但这是非常复杂且冗长的类,因此请寻找更简单的选项。
尝试使用仅一行的 GridView ,存储在 HorizontalScrollView。使用 ListAdapter 提供它,为您的单元格提供视图并设置内容展示。
我没有尝试这个,但这似乎是一个简单的解决方案。假设项目数量不会很大,因为 ListView 类中没有可用的优化。
You'd like something like ListView, but in horizontal orientation.
I'd make this to extend AbsListView, which is made to display dynamic lists.
Ideally if you'd copy ListView source and switch it to horizontal mode, but this is very complicated and long class, so look for easier options.
Try using GridView with just one row, stored in a HorizontalScrollView. Feed it with a ListAdapter, provide Views for your cells and setup content to display.
I didn't try this, but it seems like easy solution. Assuming that number of items will not be large, because there won't be optimizations available in ListView class.