我有一个有透明中心的粗圆形:
<shape
xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid
android:color="@android:color/transparent"/>
<stroke
android:width="24dp"
android:color="@android:color/white"/>
<size
android:width="72dp"
android:height="72dp"/>
</shape>
我希望您能将描边值的减少动画化,使透明中心扩张,就像虹膜一样。
<set xmlns:android="http://schemas.android.com/apk/res/android">
<objectAnimator
android:propertyName="????"
android:valueFrom="24dp"
android:valueTo="4dp"
android:duration="750"
/>
</set>
...但我不知道该指定什么属性名称。 "strokeWidth" 似乎不起作用。 我甚至不确定如何以编程方式完成它,因为 GradientDrawable.setStroke() 需要宽度和颜色,而 objectAnimator 只能操作单个参数属性。