gpt4 book ai didi

android - 如何去除 Android 中按下的 slider 的光晕?

转载 作者:太空宇宙 更新时间:2023-11-03 12:17:15 24 4
gpt4 key购买 nike

我的 Android 应用程序中有一个自定义的 SeekBar。当拇指被按下时,周围会出现一种光晕。长时间按下时,光环也会修改。我想消除这种光环效应。

我看过这个 SeekBar 文档 https://developer.android.com/reference/android/widget/SeekBar.html但看不到任何可以消除它的东西。

所以,我的问题是:如何在按下搜索栏拇指时禁用此“光环”效果? enter image description here

在此屏幕截图中,您可以看到我试图消除的白色光晕。

提前致谢!

编辑:添加 SeekBar xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/clip_connect_list_item"
android:layout_width="fill_parent"
android:layout_height="@dimen/list_item_radius"
android:background="@drawable/slider_base"
android:orientation="horizontal"
android:clickable="true">
<SeekBar android:id="@+id/seekBar1"
android:max="100"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:thumbOffset="0dp"
android:layout_gravity="center_vertical"
android:progressDrawable="@color/transparent"
android:paddingLeft="0dp"
android:paddingRight="0dp"
android:paddingTop="0dp"
android:paddingBottom="0dp"
>
</SeekBar>
</LinearLayout>

最佳答案

晚会有点晚了,但是在一个主题上将 colorControlHighlight 属性设置为 transparent 对我有用:

<style name="Base.AppTheme" parent="Theme.AppCompat.NoActionBar">
<!-- This is necessary to remove outward glow appearing on seekbar -->
<item name="colorControlHighlight">@android:color/transparent</item>
</style>

此相同颜色用于其他 UI 元素的波纹效果,因此建议用户自行决定。

关于android - 如何去除 Android 中按下的 slider 的光晕?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30452875/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com