首页 > 解决方案 > 如何在android中旋转带有动画的东西

问题描述

我是android新手,我正在学习动画。我发现我们可以使用选择器中的项目并应用为背景。如何使用动画旋转 ImageView?

标签: javaandroidanimation

解决方案


在视图(xml)中,您可以使用:

android:rotation="15" // that’s means 15 degrees

以编程方式:您可以使用旋转,例如 TextView

my_textview.rotation = 15F

//Animation:
my_textview.animate()
        .setDuration(600)
        .rotation(15f)
        .start()

推荐阅读