2013-02-17 48 views
0

AutoCompleteTextView的下拉內容是白色的單詞。但是看不清楚。如何應對這種AutoCompleteTextView的下拉內容

這是我的代碼:?

ArrayAdapter<String> myAdapter=new ArrayAdapter<String> 
(this,android.R.layout.browser_link_context_header, info_array); 

字體仍然不能看到清晰。然後我改變這樣的代碼:myAdapter.setDropDownViewResource(R.layout.dropdown_tv);

它仍然無法看到字體。請幫幫我。非常感謝!

+0

你的主題是什麼? – 2013-02-17 08:16:26

回答

2

我建議,讓你有什麼主題的應用程序,因爲它是,並且只能改變這個活動有主題爲AutoCompleteTextViewsetTheme(android.R.style.Theme);

這裏的一些傢伙通過重寫Widget.AutoCompleteTextView主題檢查didldum這裏回答解決了它它可以幫助你:

Quoted from code.google.com

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> 
... 
0

我有同樣的問題我是使用Android支持庫。和Theme.AppCompat.Light主題。

我的問題只發生在android 2.3設備上。

我不得不解決一滴的變化佈局問題倒要:

R.layout.support_simple_spinner_dropdown_item