我有一个自定义的圆形进度条。这是我确定的可绘制对象:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@android:id/secondaryProgress">
<shape
android:innerRadiusRatio="6"
android:shape="ring"
android:thicknessRatio="20.0"
android:useLevel="true">
<gradient
android:centerColor="#999999"
android:endColor="#999999"
android:startColor="#999999"
android:type="sweep" />
</shape>
</item>
<item android:id="@android:id/progress">
<rotate
android:fromDegrees="270"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="270">
<shape
android:innerRadiusRatio="6"
android:shape="ring"
android:thicknessRatio="20.0"
android:useLevel="true">
<rotate
android:fromDegrees="360"
android:pivotX="50%"
android:pivotY="50%"
android:toDegrees="0" />
<gradient
android:centerColor="?attr/colorAccent"
android:endColor="?attr/colorAccent"
android:startColor="?attr/colorAccent"
android:type="sweep" />
</shape>
</rotate>
</item>
</layer-list>
我希望它以顺时针方向显示进度,但现在它以逆时针方向显示。
我该如何改变它?
我猜你使用的是 RTL 语言?您可以通过设置将进度条强制为左或顺时针方向layoutDirection
您的财产ProgressBar
.
<ProgressBar
...
android:layoutDirection="ltr" />
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)