I want to add an image to spinner I have tried like:
<Spinner
android:id="@+id/spinner1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/myImage" />
But with this code the sign of down arrow on spinner becomes invisible please tell me how to solve that problem!! I want to do exactly Like in this image
Create a row.xml in
/res/layout/
. To to setup the layout on each row.and in Java file add this code as
In my case I have just used standard layout for spinner items and override just a little the ArrayAdapter.
Then set up adapter for your spinner:
In this approach the key was to use the setCompoundDrawablesWithIntrinsicBounds for the label