当我在我的 Seekbar 上按下拇指时,它周围会出现一个苍白的阴影,如下所示。
如何去除阴影或将其设置为透明?谢谢!
添加
android:background="@null"
例如:
<androidx.appcompat.widget.AppCompatSeekBar
android:id="@+id/seekbar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null" />
这有点不直观,但只是设置android:background="@android:color/transparent"
在 SeekBar 上。
它由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'只是搜索栏的波纹背景,这很有趣!
我想如果你改变波纹的颜色,你可以改变那个颜色。请参阅此链接以获取有关如何更改按钮波纹颜色的更多信息,相同的解决方案可能对您有用。