我在水平布局的末尾有一个textView as '+‘符号。当我按下textView时,我需要加号在同一个轴上旋转。我有这个rotate.xml文件。
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="2000"
android:fromDegrees="0"
android:pivotX="0%"
android:pivotY="0%"
android:toDegrees="360"
android:toYScale="0.0"
android:toXScale="0.0"/>但这会让我的加号到处跑。帮我在同一个轴上旋转我的textView。
发布于 2017-02-02 16:27:57
不需要仅为旋转设置Xscale & Yscale属性
如果你想从中心旋转"+“,那么轴心应该是"50%”
这是我的工作代码,你可以试试
<?xml version="1.0" encoding="utf-8"?>
<rotate xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="1000"
android:fromDegrees="0"
android:pivotX="50%"
android:pivotY="50%"
android:interpolator="@android:anim/linear_interpolator"
android:repeatCount="infinite"
android:toDegrees="360" />https://stackoverflow.com/questions/41997311
复制相似问题