AutoCompleteTextView 失去焦点的问题
我的活动中有一个 AutoCompleteTextView 可以按其应有的方式执行。下拉弓显示正确的条目等。问题是当视图失去焦点时,文本不再可见。当再次获得焦点时,文本可见。
还有其他人遇到过这个问题吗?这是一个错误还是我做错了什么?
I have a AutoCompleteTextView within my activity that performs how it should. The dropdown bow is shown with correct entries etc. The problem is when the view looses focus the text is no longer visible. When focus is gained again the text is visible.
Has anyone else had this problem? Is it a bug or something I am doing wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许当你不聚焦项目时,文本颜色与当前主题的背景颜色相同。所以你看不到它们,只能看到你聚焦的项目文本。
解决:针对background_color设置不同的颜色。
您可以在创建 Adapter 时使用 android.R.layout.simple_dropdown_item_1line 等,或者您自己的 textViewResourceId ,例如:
Maybe when you don't focus the Item,TextColor is same as background color on current Theme .so you can't see them,just see the item text that you focus.
Solve : set different color against background_color.
you can use android.R.layout.simple_dropdown_item_1line and so on when you create Adapter ,or your own textViewResourceId like:
就像设置textview的textcolor一样简单,
It's as easy as set textcolor of textview,