【发布时间】:2020-06-17 11:37:22
【问题描述】:
我在我的 android 应用程序中使用了 AutoCompleteTextView,它工作正常。我面临的唯一问题是建议的颜色默认为白色,即我看不到任何建议。因此,当我开始输入某些内容时,列表会扩展为白色条目(不可见),但是当我单击任何项目时,我发现它正在正常工作。只有颜色似乎是问题。我正在使用以下代码。
<AutoCompleteTextView android:id="@+id/location" android:textColor="#000000"
android:layout_width="fill_parent" android:layout_height="wrap_content"></AutoCompleteTextView>
和
ArrayAdapter<String> autoadapter=new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line,cities);
city = (AutoCompleteTextView) findViewById(R.id.location);
city.setAdapter(autoadapter);
city.setThreshold(1);
city.setTextColor(Color.BLACK);
谁能告诉我问题是什么?
-提前致谢
【问题讨论】:
-
我已经通过关注这个人解决了同样的问题:stackoverflow.com/a/11787982/1265456
-
这可能不是错误。另见this answer 和我在它下面的评论。
-
查看我支持
lollipop版本的新答案
标签: android colors autocompletetextview