Android SeekBar custom rectangle thumb visual bug(Android SeekBar 自定义矩形拇指视觉错误)
问题描述
我尝试使用可绘制的timeline_runner.png
I try to set custom rectangle thumb with drawable timeline_runner.png
我的activity.xml中的SeekBar:
SeekBar in my activity.xml:
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:maxHeight="10dp"
android:minHeight="10dp"
android:progressDrawable="@drawable/seek_bar_video"
android:thumb="@drawable/timeline_runner"
android:thumbOffset="0dp"
android:padding="0dp"
android:layout_weight="1"
android:layout_marginLeft="17dp"
android:layout_marginRight="12dp"/>
seek_bar_video.xml:
seek_bar_video.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@android:id/background"
android:drawable="@drawable/timeline_grey"
android:height="10dp"
android:gravity ="center"
/>
<item android:id="@android:id/progress">
<scale
android:drawable="@drawable/timeline_yellow"
android:scaleWidth="100%"
android:height="10dp" />
</item>
</layer-list>
在版本
21 一切正常.
At versions < 21 all are working fine.
但在21+时移动拇指出现灰色圆圈:
But at 21+ when moving thumb appears grey circle:
我怎样才能删除它?
推荐答案
要禁用 SeekBar 拇指上的涟漪效果,您必须 null
背景,例如
to disable the ripple effect on your SeekBar's thumb you can have to null
the background, E.g.
android:background="@null"
这篇关于Android SeekBar 自定义矩形拇指视觉错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Android SeekBar 自定义矩形拇指视觉错误


- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01
- 如何指定 CORS 的响应标头? 2022-01-01
- 获取数字的最后一位 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- 转换 ldap 日期 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01