How to change the counter image

If we see a spinner, it looks like a text image and the image to the right of the textview. In Motorola, the milestone is that the image is down arrow, while in the Samsung Galaxy Ace it is arrow to the right. I can set the background image to the counter using the following code. But I do not want to change the background image. I want to change this image. How to set this counter image.

Spinner sp1 = (Spinner) findViewById(R.id.spnContactTypes1); sp1.setBackgroundResource(R.drawable.icon); 
+5
android android spinner
Jul 20 '11 at 13:01
source share
1 answer

Do you want to change the stretcher selector

This is done using:

 <Spinner android:id="@+id/my_spinner" android:layout_width="fill_parent" android:layout_height="wrap_content" android:drawSelectorOnTop="true" android:spinnerSelector="@drawable/myspinner_selector"> 

and 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:state_dropdown_showing="true" android:drawable="@drawable/btn_dropdown_down"/> <!-- other states ... --> </selector> 
+1
Jul 20 2018-11-11T00:
source share



All Articles