【发布时间】:2018-09-14 05:14:51
【问题描述】:
我有一个要设置动画的复选框,例如当用户点击复选框时,它会显示动画。如果我使用 xml 设置它,它会在初始显示上运行动画,但我希望动画仅在用户选中复选框时运行。只有当我以编程方式设置它时才有可能。
我已经尝试过的:-
<CheckBox
android:id="@+id/_like_heart"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:background="@mipmap/ic_user_heart"
android:button="@null"
android:checked="false"
android:stateListAnimator="@animator/enlarge" />
是否有任何替代方案也可以支持较低版本的android。
【问题讨论】: