1

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.

Daniele B
  • 19,801
  • 29
  • 115
  • 173

3 Answers3

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

yourdrawable.xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

    <gradient android:startColor="your color" android:endColor="your color"
        android:angle="45"/>

    <corners android:radius="6dp" />

</shape>
KDeogharkar
  • 10,939
  • 7
  • 51
  • 95
0

I found this solution for changing the scrollbar color globally:

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

Community
  • 1
  • 1
Daniele B
  • 19,801
  • 29
  • 115
  • 173
0

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

Make a style in style.xml like below:

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

then in xml of spinner :

android:popupTheme="@style/App_SpinnerStyle"

Tried and tested!!

Ankit Jain
  • 30
  • 3