正如我在标题中所说,当我使用 setProgressDrawable 时,它会填充整个 SeekBar:如果进度为 34%,则进度显示 100%,但拇指显示正确的百分比为 34%。我不明白可能是什么问题......
done.setProgressDrawable(getResources().getDrawable(R.drawable.seekbar_progress));
done.setThumb(getResources().getDrawable(R.drawable.seekbar_thumb));
seebar_progress.xml
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="line">
<stroke android:width="15dp" android:color="#52a8ec"/>
seebar_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>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)