结合Spinner和AutoCompleteTextView [英] Combine Spinner and AutoCompleteTextView

查看:96
本文介绍了结合Spinner和AutoCompleteTextView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问自己是否可以将SpinnerAutoCompleteTextView组合在一起.基本上,我想要一个AutoCompleteTextView,当我单击它时,它显示Array中的所有条目.

I am asking myself if it is possible, to combine a Spinner and a AutoCompleteTextView. Basically I want an AutoCompleteTextView, that shows all entries from Array when I click it.

有人知道怎么做吗?

推荐答案

尝试以下代码:

 ArrayAdapter myAdapter = new ArrayAdapter<String>(this,
                    android.R.layout.simple_dropdown_item_1line, YOUR_ARRAY);
    myAutoCompleteTextView.setAdapter(myAdapter );

这篇关于结合Spinner和AutoCompleteTextView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆