Hello i want to change default orange color to red while selecting list item from spinner below is my code
To put Text in middle in spinner list and remove radio button in selection i have make custom adapter
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.range, R.layout.middle_text_spinner);
spBAFirst.setAdapter(adapter);
now xml file for middle_text_spinner is below…
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/spinnerItemStyle"
android:singleLine="true"
android:layout_width="fill_parent"
android:textColor="@color/tabDark"
android:layout_height="wrap_content"
android:gravity="center" />
Now Image of spinner is below

First of all i want to change color of this Middle text to white instead of black
but when the list open all the text must be BLACK and white background but in some phone text will become white

Now i want to change default color orange to RED while selecting the list
I have Googled but can not change color while selecting
i have tried with listSelector but it can not be done and used also below is my code
this is in drawable folder btn_red_color.xml file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:state_focused="true"
android:drawable="@color/red" />
<item android:state_pressed="true"
android:drawable="@color/red" />
<item android:state_focused="true"
android:drawable="@color/red" />
</selector>
and set this value to spinner listSelector
<Spinner
android:id="@+id/spBAFirst"
style="@style/my_cust_text"
android:layout_width="100dp"
android:layout_height="35dp"
android:background="@drawable/blue_button"
android:listSelector="@drawable/btn_red_color" />
and my_cust_text style is
<style name="my_cust_text">
<item name="android:layout_width">0dp</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:ellipsize">marquee</item>
<item name="android:lines">1</item>
<item name="android:maxLines">1</item>
<item name="android:layout_weight">1</item>
<item name="android:entries">@+array/range</item>
<item name="android:layout_marginLeft">-3dip</item>
<item name="android:layout_marginRight">-3dip</item>
<item name="android:gravity">center</item>
</style>
but it is not working 🙁 please can any body help me
I have find solution by this way you can be surely do it 90% of your work 🙂 You can show RED highlighted color
make CustomAdapter called MySpinnerAdapter…
put this file in drawable folder btn_red_color.xml
Spinner’s xml file is like this
Middle_text_spinner.xml file is below
so enjoy 🙂