如何在Android启动画面中为徽标添加Bounce动画效果?

时间:2014-05-22 07:43:38

标签: android animation splash-screen

我已经在中心创建了一个带有徽标的启动画面,现在我想添加动画,就像徽标从屏幕顶部下垂一样,它会弹回一次并停在屏幕中央。

任何人都可以帮助我。

1 个答案:

答案 0 :(得分:2)

First position your logo to the center take reference of that logo and check below code : 

bounce.xml

<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
    android:fillAfter="true"
    android:interpolator="@android:anim/bounce_interpolator">

    <scale
        android:duration="2000"
        android:fromXScale="1.0"
        android:fromYScale="0.0"
        android:toXScale="1.0"
        android:toYScale="1.0" />

</set>

use abow xml in your splash activity like this : 

Animation an2=AnimationUtils.loadAnimation(this,R.anim.bounce);
your_logo.startAnimation(an2);