问题描述
我目前使用的是HorizontalListView,我使用addView方法添加项目。
有没有一种方法来填充一个ArrayAdapter一个HorizontalListView以同样的方式,你可以为一个ListView,这始终是垂直的?
I'm currently using a HorizontalListView which I add items to by using the addView method. Is there a way to populate a HorizontalListView with an ArrayAdapter in the same way as you can for a ListView, which is always vertical?
推荐答案
我假设你的意思是你正在使用HorizontalScrollView,因为没有这样的东西作为HorizontalListView。如果你想实现你的最好的拍摄是创建该类型的ListView自己,即。通过子类化 AbsListView
或适配器视图
。或者你可以只用偷别人code,这样:)
I assume you meant you are using HorizontalScrollView, because there is no such thing as HorizontalListView. If you want to accomplish that your best shot is to create that type of ListView yourself, ie. by subclassing AbsListView
or AdapterView
. Or you could just use somebody elses code, like this Horizontal ListView :)
这篇关于你如何使用ArrayAdapter的HorizontalListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!