2013-10-29 36 views
1

我正在使用下面的动画在android中获得心脏吹气效果,但动画看起来像心脏符号越来越小,然后变大,但我想反过来效果(首先它应该变大然后小)。在android中显示心脏动画

我真的不知道如何修改这个动画来获取大图像。

动画应用于:

<scale xmlns:android="http://schemas.android.com/apk/res/android" 
    android:duration="1000" 
    android:fromXScale="1" 
    android:fromYScale="1" 
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:repeatCount="1" 
    android:repeatMode="reverse" 
    android:toXScale="0.5" 
    android:toYScale="0.5" /> 

请帮我解决这个问题。

回答

4

这听起来像你正在寻找这样的东西。编辑从/到缩放以达到您要查找的效果。

<scale xmlns:android="http://schemas.android.com/apk/res/android" 
    android:duration="1000" 
    android:fromXScale="1" 
    android:fromYScale="1" 
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:repeatCount="1" 
    android:repeatMode="reverse" 
    android:toXScale="1.5" 
    android:toYScale="1.5" /> 
+0

非常感谢你马特 – user1891910

+0

我还有一个我可以问你 – user1891910

+0

来吧!询问。 –

1

试试这个这个animation..animates视图到小变大,反之亦然

<scale xmlns:android="http://schemas.android.com/apk/res/android" 
    android:duration="1000" 
    android:fromXScale="0.5" 
    android:fromYScale="0.5" 
    android:pivotX="50%" 
    android:pivotY="50%" 
    android:repeatCount="infinite" 
    android:repeatMode="reverse" 
    android:toXScale="1.5" 
    android:toYScale="1.5" />