【发布时间】:2011-12-30 04:27:18
【问题描述】:
在一个 AutoCompleteTextView 结果中有两个 TextView 吗?
例如
-------------------------------
result 1 title
result 1 alt text
-------------------------------
result 2 title
result 2 alt text
-------------------------------
等等……
ArrayAdapter 只允许一个视图绑定一个视图,那么如何在适配器中绑定更多视图呢?
像这样:
(...= new ArrayAdapter<String>(this, android.R.layout.simple_dropdown_1item, R.id.list_item, String[]);
我已经为 ArrayAdapter 中的布局参数创建了一个新的 xml 布局,除非我将 TextView 绑定到字符串数组,它只将文本设置为具有给定 id 的 TextView。
我也搜索过关于这个的其他帖子,但它不适合我的需要。
如果有人能提供帮助,那就太好了:)
谢谢。
【问题讨论】:
标签: android autocomplete textview android-arrayadapter