Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android don';t正常缩放动画_Android_Scale_Android Animation - Fatal编程技术网

Android don';t正常缩放动画

Android don';t正常缩放动画,android,scale,android-animation,Android,Scale,Android Animation,我想创建一个如下所示的动画: 它从左下角缩放到右上角 以下是我目前的代码: <set xmlns:android="http://schemas.android.com/apk/res/android" > <scale android:duration="500" android:fillAfter="true" android:fromXScale="0.0" android:fromYScale="1.0" android:toX

我想创建一个如下所示的动画: 它从左下角缩放到右上角

以下是我目前的代码:

<set xmlns:android="http://schemas.android.com/apk/res/android" >

<scale
    android:duration="500"
    android:fillAfter="true"
    android:fromXScale="0.0"
    android:fromYScale="1.0"
    android:toXScale="1.0"
    android:toYScale="1.0"
    >
</scale>

</set>


有关于如何制作动画的教程吗?我理解这个概念,但我不知道所有的变量,比如pivotX和pivotY。

试试这个

这里我将动画设置为image 在res目录中创建名为anim的新文件夹,并保存动画xml

使用
AnimationUtils.loadAnimation(this,R.anim.xmlname)


我所做的是使用pivotX和pivotY:

<scale
    android:duration="300"
    android:fillAfter="true"
    android:fromXScale="0.0"
    android:fromYScale="0.0"
    android:toXScale="1.0"
    android:toYScale="1.0"
    android:pivotX="0%"
    android:pivotY="100%"
    >
</scale>

枢轴是动画的起点

<scale
    android:duration="300"
    android:fillAfter="true"
    android:fromXScale="0.0"
    android:fromYScale="0.0"
    android:toXScale="1.0"
    android:toYScale="1.0"
    android:pivotX="0%"
    android:pivotY="100%"
    >
</scale>