微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – setProgressDrawable填充整个seekBar

正如我在标题中所说,当我使用setProgressDrawable时,它会填满整个SeekBar:如果进度为34%,则进度显示为100%但拇指显示正确的百分比34%.我不知道可能是什么问题……
done.setProgressDrawable(getResources().getDrawable(R.drawable.seekbar_progress));
   done.setThumb(getResources().getDrawable(R.drawable.seekbar_thumb));

seekbar_progress.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="15dp"    android:color="#52a8ec"/>

seekbar_thumb.xml

<shape xmlns:android="http://schemas.android.com/apk/res/android"
 android:shape="rectangle">
<gradient android:startColor="#ffffffff" android:endColor="#ff585858" android:angle="270"/>
<size android:height="17dp" android:width="5dp"/>
</shape>

任何的想法?

先感谢您!

解决方法

尝试将填充形状放在剪辑标签
<clip>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="15dp"    android:color="#52a8ec"/>
</clip>

原文地址:https://www.jb51.cc/android/310213.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐