4

当我在我的 Seekbar 上按下拇指时,它周围会出现一个苍白的阴影,如下所示。

在按下并单击它之前。 如何去除或改变它周围的淡灰色。

如何去除阴影或将其设置为透明?谢谢!

4

4 回答 4

5

添加

android:background="@null"

例如:

<androidx.appcompat.widget.AppCompatSeekBar
    android:id="@+id/seekbar"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@null" />
于 2019-12-10T07:28:35.620 回答
2

这有点不直观,但只是设置android:background="@android:color/transparent"在 SeekBar 上。

于 2019-10-01T17:27:53.167 回答
0

它由colorControlHighlight

所以


<androidx.appcompat.widget.AppCompatSeekBar
            android:id="@+id/seekbar"
            android:layout_width="0dp"
            android:layout_height="35dp"
            android:layout_weight="1"
            android:theme="@style/seekBarStyle"
            />

    <style name="seekBarStyle">
        <item name="colorAccent">#0394D6</item>
        <item name="colorControlHighlight">#22ffffff</item>
        <item name="android:textColorSecondary">#fff</item>
    </style>

好的,'highlight'只是搜索栏的波纹背景,这很有趣!

于 2019-05-03T06:43:52.110 回答
0

我想如果你改变波纹的颜色,你可以改变那个颜色。请参阅此链接以获取有关如何更改按钮波纹颜色的更多信息,相同的解决方案可能对您有用。

于 2018-04-05T20:49:57.147 回答