AutoCompleteTextView does not properly display tex

2019-05-14 05:42发布

I'm using ActionBarSherlock with the Theme.Sherlock.Light.DarkActionBar theme and the text in my AutoCompleteTextView is so the same colour as the background. I have tried calling setTextColour() and passing in the int referring to Black, but it doesn't seem to make any difference.

Is this a known bug? Or an unknown bug? Or am I just missing something?

Here's a screenshot showing how it looks when selected - which suggests it's not jut a case of being the same colour as the background:

screenshot of the problem - with text selected

2条回答
Juvenile、少年°
2楼-- · 2019-05-14 06:23

Are you using getSupportActionBar().getThemedContext() for inflating the views in your adapter? The action bar context is different than the regular context since the colors are reversed.

查看更多
【Aperson】
3楼-- · 2019-05-14 06:35

My issue seems unrelated to ABS. I came across the solution here:

http://code.google.com/p/android/issues/detail?id=5237

Using android.R.layout.simple_dropdown_item_1line instead of android.R.layout.simple_list_item_1 worked for me in all Android versions.

查看更多
登录 后发表回答