Android 水平图像旋转

Android 水平图像旋转,android,animation,rotation,Android,Animation,Rotation,我有一个图片顺时针旋转的动画(垂直空间)。反过来,我需要使图片在水平空间中旋转 我的垂直旋转示例,请帮助我进行水平旋转: <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:shareInterpolator="false" > <rotate android:du

我有一个图片顺时针旋转的动画(垂直空间)。反过来,我需要使图片在水平空间中旋转

我的垂直旋转示例,请帮助我进行水平旋转:

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false" >

    <rotate
        android:duration="2500"
        android:fromDegrees="0"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toDegrees="360" />

</set>

在资源->创建动画文件夹->任意名称的xml文件中

     <set xmlns:android="http://schemas.android.com/apk/res/android"
    android:shareInterpolator="false">
  <scale
            android:fromXScale=".3"
            android:toXScale="1.0"
            android:fromYScale="0.3"
            android:toYScale="1.0"
            android:pivotX="50%"
            android:pivotY="50%"
            android:duration="800" />

        <rotate
            android:fromDegrees="0"
            android:toDegrees="180"

            android:pivotX="50%"
            android:pivotY="50%"
            android:duration="800" />

</set>
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    setContentView(R.layout.[yourlayout]);

    findViewById(R.id.outer).startAnimation(AnimationUtils.loadAnimation(this,R.anim.your_file_nmae));

}