I have an AutoCompleteTextView component and I want to change its default drop down selector to another color. First I tried: android:dropDownSelector="#FF400000"
, but it caused no selector to appear at all! Next I put the color in a drawable resource:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@android:color/holo_blue_dark"/>
</shape>
And linked it: android:dropDownSelector="@drawable/drop_down_selector"
, but that did the same effect (no selector). Next I found a similar issue someone opened, just for spinner: http://code.google.com/p/android/issues/detail?id=24922, so I tried defining a style as was explained in the solution there:
<style name="AutoCompleteDropDown" parent="@android:style/Theme.Holo.Light">
<item name="android:dropDownListViewStyle">@style/AutoCompleteSelector</item>
</style>
<style name="AutoCompleteSelector" parent="@android:style/Widget.Holo.Light.ListView">
<item name="android:listSelector">#FF400000</item>
</style>
And linked it: style="@style/AutoCompleteDropDown"
, but it did nothing (however, the default selector got back since I removed the dropDownSelector
attribute).
So what am I missing here? What am I doing wrong?
UPDATE: Ok, so as was suggested, I also tried a selector:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:state_pressed="true"
android:state_focused="true" android:state_activated="true"
android:drawable="@android:color/holo_green_light"/>
</selector>
But it didn't work, I still get no selector (at least not one I can see).