【发布时间】:2019-04-23 01:33:32
【问题描述】:
我用 XML 制作了一个相当简单的动画,并在图像上运行。 动画使图像旋转,但问题是动画不是很流畅。
minSdkVersion 16
targetSdkVersion 28
XML 动画 rotate.xml 代码
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
<rotate android:fromDegrees="0"
android:toDegrees="360"
android:duration="600"
android:interpolator="@android:anim/cycle_interpolator"/>
在我的 java/kotlin MainActivity 类中
lateinit var rotate: Animation
在我的 Oncreate 函数中
rotate = AnimationUtils.loadAnimation(this, R.anim.rotate)
我如何开始动画
btnFishing.startAnimation(rotate)
当我在手机上运行应用程序并测试动画时,它看起来非常不稳定且不流畅。 我尝试录制动画,但事实证明在录制中动画很流畅嗯..
【问题讨论】:
标签: java android animation rotation smoothing