I have searching and testing to set my own image/icon in a Spinner but i get error.
I have alrady with styling set background image but then the spinner icon on the right side not shows anymore.
When i do like i find a example of like this:
<Spinner style="@style/Spinner" android:spinnerSelector="@drawable/myspinner_selector" />
And here is the myspinner_selector.xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_first="true"
android:drawable="@drawable/arrowdown"
/>
<item android:state_middle="true"
android:drawable="@drawable/arrowdown"
/>
<item android:state_last="true"
android:drawable="@drawable/arrowdown"
/>
<item android:state_single="true"
android:drawable="@drawable/arrowdown"
/>
But it is in the first XML
for spinner I get this error:
No resource identifier found for attribute 'spinnerSelector' in package 'android' `main.xml`
All example i can find on internet using the styling of spinner selector like this but i can not get it to work and can not find spinnerSelector
in the reference guide on developer.android.com either.
I have the same problem. The only workaround I found is combining the selector icon to the background and then override the background only. Don't use the android:spinnerSelector attribute.
I didn't get the answer for changing the spinner image but you can do it..
Set the spinner height and width to 0dp
Create a button in the onClick() listener and call click action of the spinner like this
Change the button text to match the spinner text.
Now you can change the image of the button easily!
I Think that xml style was changed
http://developer.android.com/design/building-blocks/spinners.html