1
votes

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.

3
You mean the background color of the pop up?varunkr
I mean the color of the scrollbar of the popupDaniele B

3 Answers

0
votes
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>
0
votes

I found this solution for changing the scrollbar color globally:

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

0
votes

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!!