AutoCompleteTextview 颜色默认设置为白色 [英] AutoCompleteTextview Color set white by default
问题描述
我在我的 android 应用程序中使用了 AutoCompleteTextView,它工作正常.我面临的唯一问题是建议的颜色默认为白色,即我看不到任何建议.因此,当我开始输入某些内容时,列表会以白色条目(不可见)展开,但是当我单击任何项目时,我发现它可以正常工作.似乎只有颜色是问题.我正在使用以下代码.
I used an AutoCompleteTextView in my android app and it is working correctly. The only problem I am facing is that the color of the suggestions is white by default that is i am not able to see any suggestions. So when i start typing something the list expands with white entries(invisible), but when i click on any item i find that it is working as it should be. Only the color seems to be the problem. I am using the following code.
<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);
谁能告诉我这是什么问题??
- 提前致谢
Can anyone please tell me what the problem is??
-Thanks in advance
推荐答案
这是一个记录的错误,
您可以在同一个链接中找到一些修复方法.
You can find some ways to fix it in the same link.
注意:此解决方案不适用于 lollipop
希望能帮到你...
这篇关于AutoCompleteTextview 颜色默认设置为白色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!