Here image of spinner . i want change spinner default drop down icon color.
Asked
Active
Viewed 8,609 times
-1
-
use custom spinner adapter – KOTIOS Jun 11 '14 at 10:16
-
hey Refer This answer : http://stackoverflow.com/questions/20032594/android-need-to-change-the-spinner-background-color – Pragnesh Ghoda シ Jun 11 '14 at 10:17
-
@Prag's need to change icon color not background – Rizwan Ahmed Jun 11 '14 at 10:22
-
you mean dropdown icon?? – Pragnesh Ghoda シ Jun 11 '14 at 10:24
-
yes dropdown default icon – Rizwan Ahmed Jun 11 '14 at 10:26
-
view my answer link will tell you how to deal with it.. – Pragnesh Ghoda シ Jun 11 '14 at 10:30
-
that is for custom icon.. i am using default spinner dropdown icon. you can see left side of today text – Rizwan Ahmed Jun 11 '14 at 10:34
-
what you want to do with it.......... – Pragnesh Ghoda シ Jun 11 '14 at 10:37
-
Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/55423/discussion-between-prags-and-rizwan-ahmed). – Pragnesh Ghoda シ Jun 11 '14 at 10:38
3 Answers
1
create a new XML file in the drawable folder(background.xml)
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_focused="true"
android:state_pressed="false"
android:drawable="@drawable/myspinner_select" />
<item android:state_focused="true"
android:state_pressed="true"
android:drawable="@drawable/myspinner_press" />
<item android:state_focused="false"
android:state_pressed="true"
android:drawable="@drawable/myspinner_press" />
<item android:drawable="@drawable/myspinner_normal" />
</selector>
associate this Spinner drawable in your XML layout file
<Spinner android:id="@+id/spinner_chemical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:drawSelectorOnTop="true"
android:background="@drawable/background"/>
this may help you..

Taryn
- 242,637
- 56
- 362
- 405

Pragnesh Ghoda シ
- 8,318
- 3
- 25
- 40
0
You can set the spinners background color in xml like this:
android:background="YOUR_HEX_COLOR_CODE"
and if you use the drop down menu with you spinner you can set its background color like this:
android:popupBackground="YOUR_HEX_COLOR_CODE"
Reference : https://stackoverflow.com/a/13550512/3492139