Skip to content Skip to sidebar Skip to footer

Android: Change Color Of Spinner's Popup Scrollbar

How can I change the color of the spinner's popup scrollbar? For some reason the color of the scrollbar is currently white on a white background, it is not visible.

Solution 1:

add android:scrollbarThumbVertical="@drawable/yourdawable //in your spinner 

yourdrawable.xml

<?xml version="1.0" encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apk/res/android"><gradientandroid:startColor="your color"android:endColor="your color"android:angle="45"/><cornersandroid:radius="6dp" /></shape>

Solution 2:

I found this solution for changing the scrollbar color globally:

How can I change the color of the scrollbar in Android?

Solution 3:

You can change the style of spinner to change the spinner color.

Make a style in style.xml like below:

<stylename="App_SpinnerStyle" ><itemname="android:scrollbarThumbVertical">@color/colorAccent</item></style>

then in xml of spinner :

android:popupTheme="@style/App_SpinnerStyle"

Tried and tested!!

Post a Comment for "Android: Change Color Of Spinner's Popup Scrollbar"