1

如何更改微调器弹出滚动条的颜色?

由于某种原因,滚动条的颜色当前是白色背景上的白色,它是不可见的。

4

3 回答 3

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>
于 2016-05-11T12:57:48.147 回答
0

我找到了用于全局更改滚动条颜色的解决方案:

如何更改 Android 中滚动条的颜色?

于 2016-05-13T06:26:10.030 回答
0

您可以更改微调器的样式以更改微调器的颜色。

在 style.xml 中创建一个样式,如下所示:

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

然后在微调器的 xml 中:

android:popupTheme="@style/App_SpinnerStyle"

尝试和测试!

于 2019-11-23T06:51:47.190 回答