Android image animation for splash screen

旧时模样 提交于 2020-01-03 02:56:11

问题


Hi i am pretty new to android application .now i am creating one m-commerce android application.so i want to create one splash screen with animation,Its like the gift boxes will fall from top to bottom of the activity with rotation functionality.please help me out

Advance thanks


回答1:


create animation resource file named rotate_move_down.xml inside res/anim directory

<set xmlns:android="http://schemas.android.com/apk/res/android" android:fillAfter="true">
    <!-- Rotate -->
    <rotate
        android:duration="1200"
        android:fromDegrees="0"
        android:interpolator="@android:anim/linear_interpolator"
        android:pivotX="50%"
        android:pivotY="50%"
        android:toDegrees="360" />

    <!--  down move -->
    <translate
        android:duration="1500"
        android:fromYDelta="0%p"
        android:interpolator="@android:anim/linear_interpolator"
        android:toYDelta="80%p" />
</set>

and use this animation to the splash activity like this .

 Animation animation= AnimationUtils.loadAnimation(MainActivity.this,R.anim.rotate_move_down);
imageView.startAnimation(animation);

imageView in your xml file.



来源:https://stackoverflow.com/questions/31536452/android-image-animation-for-splash-screen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!