Change spinner background color but keep arrow

Mansur Khan picture Mansur Khan · Sep 16, 2014 · Viewed 82.7k times · Source

I've read several thing about it but I can't find what I need. I want to keep the grey arrow but I want to remove the horizontal bar from the default style and have a white background. Do you have any idea of how I can do this ?

Here is what I have now (default spinner style) :

enter image description here

Here is what I want :

enter image description here

Answer

Chandler picture Chandler · Oct 28, 2016

I did a little modification based on @Mansur Khan 's answer.

We don't have to add an ImageView in this case because the spinner already has a triangle arrow. So check the code below:

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:padding="8dp"
        android:background="#FFFFFF">
        <Spinner
            style="@style/Widget.AppCompat.DropDownItem.Spinner"
            android:layout_width="match_parent"
            android:layout_height="70dp"
            android:id="@+id/sign_up_country"
            />
    </RelativeLayout>

Here is the screenshot

Before: enter image description here

After: enter image description here