我用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)
当我在我的手机上运行应用程序并测试动画时,它看起来非常不稳定和不流畅。我试着录制动画,但在录制中动画是流畅的,嗯。
发布于 2018-12-05 04:03:20
修正了这个问题,我想要动画的图像太大了。我首先使用了500*500px,并通过将图像大小调整为100*100px来修复它
https://stackoverflow.com/questions/53395844
复制相似问题