Tuan
Tuan

Reputation: 2423

Change background and item color of a spinner

enter image description here

Does anyone know how I can change the background color and the item color on the spinner?

    <Spinner
        android:id="@+id/spinner_categoryselect"
        android:background="@drawable/side_nav_bar"
        android:background="#CCC"
        android:layout_weight="4"
        android:layout_width="0dp"
        android:layout_height="wrap_content"></Spinner>

Thanks in advance.

Upvotes: 1

Views: 167

Answers (4)

user6095620
user6095620

Reputation:

<Spinner android:id="@+id/spinner"
     ...
     android:background="#YOUR_COLOR"/>

Upvotes: 1

Maraj Hussain
Maraj Hussain

Reputation: 1596

You can simply change popup background color:

Use android:popupBackground on the Spinner in your XML or setPopupBackgroundResource(int) in code.

Check here Dupllicate question

Upvotes: 0

Kvaibhav01
Kvaibhav01

Reputation: 391

You can simply use the following attribute in your <spinner> tag

android:background="#000000"

If you want to change the background color for drop-down menu then

android:popupBackground="#000000"

Upvotes: 0

Ratilal Chopda
Ratilal Chopda

Reputation: 4220

Try this my friend

android:popupBackground="#000000"

Upvotes: 1

Related Questions