【问题标题】:How to add a Bounce animation effect for logo in Android splash screen?如何在 Android 启动画面中为 logo 添加 Bounce 动画效果?
【发布时间】:2014-05-22 07:43:37
【问题描述】:

好吧,我已经创建了一个带有徽标在中心的启动画面,现在我想向它添加动画,就像徽标从屏幕顶部掉落一样,它反弹一次并停在屏幕中心。

谁能帮帮我。

【问题讨论】:

标签: android animation splash-screen


【解决方案1】:
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);

【讨论】:

    猜你喜欢
    • 2015-08-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-12-30
    • 2021-06-28
    相关资源
    最近更新 更多