Skip to content Skip to sidebar Skip to footer

Button Disappears After Animation

i have a button that i animating when touched. the animation is working but after the animation is compelete, i am calling setAnimation(null) to reset the button, but the button is

Solution 1:

Please try this:

animation.setAnimationListener(newAnimation.AnimationListener() {
        @OverridepublicvoidonAnimationStart(Animation animation) {
            aView.setVisibility(View.VISIBLE);
        }

        @OverridepublicvoidonAnimationEnd(Animation animation) {

            button.clearAnimation();

        }

        @OverridepublicvoidonAnimationRepeat(Animation animation) {

        }
    });

Hope this will help you.

Solution 2:

If you want to reset the position try Animation.reset();

animate.setAnimationListener(newAnimationListener() {
    @OverridepublicvoidonAnimationEnd(Animation animation)
    {
        animation.reset();
    }
}

Post a Comment for "Button Disappears After Animation"