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

前端之家收集整理的这篇文章主要介绍了使用xml从右上角到左下角的Android动画前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正试图从右侧的操作栏打开一个对话框.我希望动画从右上角到左下角加载.这是我所拥有的,但它从左上角到右下角加载.我试图改变它无济于事.谢谢你的帮助.

<?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>

解决方法

抱歉,比赛迟了几个月,但最好的方法和推荐的方式是

<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>

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

猜你在找的XML相关文章