Android AutoCompleteTextView的下拉内容
Android AutoCompleteTextView的下拉内容,android,themes,autocompletetextview,Android,Themes,Autocompletetextview,AutoCompleteTextView的下拉内容是白色单词。但这并不清楚。如何应对 这是我的代码: ArrayAdapter<String> myAdapter=new ArrayAdapter<String> (this,android.R.layout.browser_link_context_header, info_array); ArrayAdapter myAdapter=新的ArrayAdapter (这是android.R.layout.browser
AutoCompleteTextView
的下拉内容是白色单词。但这并不清楚。如何应对
这是我的代码:
ArrayAdapter<String> myAdapter=new ArrayAdapter<String>
(this,android.R.layout.browser_link_context_header, info_array);
ArrayAdapter myAdapter=新的ArrayAdapter
(这是android.R.layout.browser\u link\u context\u头、info\u数组);
字体仍然看不清楚。然后我更改如下代码:myAdapter.setDropDownViewResource(R.layout.dropdown\u tv)代码>
它仍然看不到字体。请帮帮我。非常感谢 我建议保持应用程序的主题不变,只将此活动中具有AutoCompleteTextView
的主题更改为setTheme(android.R.style.theme)代码>
这里有人通过覆盖Widget.AutoCompleteTextView
主题检查解决了这个问题。回答这里它可能会帮助您:
1. use an extended theme in your manifest:
...
<application android:theme="@style/Theme.Light.NoTitleBar.Workaround" ... >
...
2. create the new theme (res/values/themes.xml) which uses fixed styles:
...
<style name="Theme.Light.NoTitleBar.Workaround" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:autoCompleteTextViewStyle">@style/AutoCompleteTextViewLight</item>
<item name="android:dropDownItemStyle">@style/Widget.DropDownItemLight</item>
</style>
...
3. create the styles (res/values/styles.xml) which fix the color:
...
<style name="AutoCompleteTextViewLight" parent="@android:style/Widget.AutoCompleteTextView">
<item name="android:textColor">@android:color/primary_text_light</item>
</style>
<style name="Widget.DropDownItemLight" parent="@android:style/Widget.DropDownItem">
<item name="android:textColor">@android:color/primary_text_light</item>
</style>
...
1。在清单中使用扩展主题:
...
...
2.创建使用固定样式的新主题(res/values/themes.xml):
...
@样式/自动完成TextViewLight
@style/Widget.DropDownItemLight
...
3.创建修复颜色的样式(res/values/styles.xml):
...
@安卓:颜色/主文本光
@安卓:颜色/主文本光
...
我也遇到了同样的问题,但我使用的是android支持库。和Theme.AppCompat.Light
Theme
我的问题只发生在安卓2.3设备上
我将下拉列表的布局更改为:
R.layout.support_simple_spinner_dropdown_item