tags:

views:

16

answers:

0

Hello everyone, I've a quick question.

I'm trying to animating a child view to make it disappear. That part is easy, but, during the animation, the parent view is not resized. How can I do to make the parent view automtically resize during the animation?

Here is my current code:

    AnimationSet set = new AnimationSet(true);

    Animation fade = new ScaleAnimation(1.f, 1.f, 1.f, 0);        
    Animation fade2 = new AlphaAnimation(1, 0);

    set.addAnimation(fade);
    set.addAnimation(fade2);
    set.setDuration(2000);
    set.setFillAfter(true);        

    bgColor.startAnimation(set);

bgColor is the View I'm making disappear. Here is the final result : Result

You can see the gap after the animation.

Any ideas?

Thanks in advance!