Android – when I change the background color, the rotation arrow disappears

When I change the background color of my spinner, the drop-down arrow disappears. I see some answers to similar questions here, but they don't really solve how to "reappear" the arrow or change the color of the arrow directly from XML (assuming possible)

I tried to make the arrow white, but the spinner (using the code below) still doesn't have an arrow

<Spinner
    android:id="@+id/eventSpinner"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
    android:layout_alignParentTop="true"
    android:background="@android:color/holo_green_dark"
    android:dropDownSelector="#ffffff"
    android:popupBackground="@android:color/holo_green_dark"
    android:spinnerMode="dropdown" />

Any help will be greatly appreciated. Thank you in advance

resolvent:

You can draw lines through XML code as follows

    <item >

    <layer-list>

        <item>
            <shape android:shape="rectangle" >
                <solid android:color="@android:color/transparent" />
                <!-- background color of @R_651_2419@ -->
            </shape>
        </item>
        <item
            android:left="-2dp"
            android:right="-2dp"
            android:top="-2dp">
            <shape>
                <solid android:color="@android:color/transparent" />

                <stroke
                    android:width="1dp"
                    android:color="#323232" />
                <!-- color of stroke -->
            </shape>
        </item>

        <item android:right="5dp">
            <bitmap android:gravity="center_vertical|right" android:src="@drawable/downlarrow" />

        </item>

    </layer-list>

   </item>

The output looks like this

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>