Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/205.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
使用xml从右上到左下的Android动画_Android_Android Animation_Android Xml - Fatal编程技术网

使用xml从右上到左下的Android动画

使用xml从右上到左下的Android动画,android,android-animation,android-xml,Android,Android Animation,Android Xml,我正试图从右侧的操作栏打开一个对话框。我想从右上角到左下角加载动画。这是我所拥有的,但它从左上角到右下角加载。我试着把它调换一下,但没有用。谢谢你的帮助 <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android"> <scale android:fromYScale="0" android:toYScale="1.

我正试图从右侧的操作栏打开一个对话框。我想从右上角到左下角加载动画。这是我所拥有的,但它从左上角到右下角加载。我试着把它调换一下,但没有用。谢谢你的帮助

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
    <scale android:fromYScale="0" android:toYScale="1.0"
        android:fromXScale="0" android:toXScale="1.0" 
        android:duration="500"/>
</set>

将对您有所帮助

我试过这样的东西

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/decelerate_interpolator">
    <scale
            android:fromYScale="0"
            android:toYScale="1.0"
            android:startOffset="0"
            android:duration="1200"
            android:fromXScale="0"
            android:toXScale="1.0"
            android:fillAfter="true" />
    <translate android:fromXDelta="100%" android:fromYDelta="-100%"
               android:duration="700" />
</set>

很抱歉游戏推迟了几个月,但最好的方法和推荐方法是

<set xmlns:android="http://schemas.android.com/apk/res/android"
     android:interpolator="@android:anim/decelerate_interpolator">
     <scale
            android:fromYScale="0"
            android:toYScale="1.0"
            android:startOffset="0"
            android:duration="1200"
            android:fromXScale="0"
            android:toXScale="1.0"
            android:fillAfter="true"
            android:pivotX="100%" />
</set>


正确的方法是使用动画应该来自的轴点

非常感谢您链接的资源。这对我帮助很大。