0

I am generating a Spinner without using an Adapter. The problem is that the items in the Spinner are not getting the desired color I want to set. How to do it? I have the following Spinner in my activity:

 Spinner spinner = (Spinner)findViewById(R.id.spinner1);

And here is the Xml declaration of the Spinner

<Spinner
    android:id="@+id/spinner1"
    android:layout_width="wrap_content"
    android:layout_height="40dp"
    android:prompt="@string/Select"
    android:entries="@array/profiles"
    android:layout_alignParentLeft="true"
    android:layout_below="@+id/editText1"
    android:layout_marginTop="19dp"
    android:textColor="@color/grey"
    android:background="@drawable/backgroundpic" />
anu_r
  • 1,602
  • 7
  • 30
  • 61

1 Answers1

0

Use android:popupBackground to change the spinner background

android:popupBackground="@drawable/backgroundpic"
Nambi
  • 11,944
  • 3
  • 37
  • 49
  • I want to change the color of the items in the Spinner. The background is getting changed with your code. Thanks for that. But pls suggest me how to change the text color – anu_r Mar 20 '14 at 06:46
  • for changing the textcolour of the spinner you can refer this SO link: http://stackoverflow.com/questions/6159113/android-where-is-the-spinner-widgets-text-color-attribute-hiding – Nambi Mar 20 '14 at 06:49