Cómo hacer una animación de crecer/reducir

I'm trying to make an image view to grow and reduce only on the x axis, yes, I want to deformate it. It is actually the shadow of a bouncing ball. I'm trying to achive it with the scale animation, but it translate. Anyone that can help? Here's the code of the animation that I'm using.


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

    android:toAlpha="0.0" />


preguntado el 08 de febrero de 14 a las 17:02

1 Respuestas

I tested your code out and here is what i found:

The code that you have provided initially scales the object in X axis to 1.1 directly(i.e without any animation).

Next, the object is scaled down in X axis to 0.1 while the alpha goes down. The scaling takes place about the upper left corner of the object(i.e the pivot is set to default).

If you want the scaling to happen about any other point,you can specify that as


Respondido 08 Feb 14, 18:02

android:pivotX="50%" android:pivotY="50%" This was the only thing that I missed, now it works fine. Thanks - Alejandro Cumpa

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.