我在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);

谁能告诉我问题出在哪里吗?
-提前致谢

最佳答案

这是一个已记录的错误,

您可以在同一链接中找到一些修复它的方法。

Auto complete text view bug

Bug solution

注意:此解决方案不适用于lollipop
希望对您有帮助...

关于android - AutoCompleteTextview颜色默认设置为白色,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8470804/

10-12 00:34
查看更多