1

我正在使用以下动画在 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

2 回答 2

5

听起来你正在寻找这样的东西。编辑 from/to 比例以实现您正在寻找的效果。

   <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" />
于 2013-10-29T05:50:37.120 回答
1

试试这个动画..将视图动画化为大小,反之亦然

<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" />
于 2013-10-29T05:55:20.330 回答