AutoCompleteTextview 颜色默认设置为白色

编程入门 行业动态 更新时间:2024-10-28 06:27:18
本文介绍了AutoCompleteTextview 颜色默认设置为白色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在我的 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 颜色默认设置为白色

本文发布于:2023-11-28 14:50:33,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1642859.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:设置为   白色   颜色   AutoCompleteTextview

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!