我正在尝试实现这样一种动画,在其中按钮的边框半径应该随时间变化。我对值动画概念感到困惑。下面是我的代码。
shape.xml文件
shape.xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/colorPrimary"/>
<corners android:radius="5dp"/>
</shape>
在我的视图中的按钮
<Button
android:id="@+id/button"
style="@android:style/Widget.Material.Button"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_margin="12dp"
android:background="@drawable/shape"
android:onClick="onclick"
android:text="@string/click_me"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintCircleRadius="0dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:targetApi="lollipop" />