"Android" Two view shared with the same animation object problem

Source: Internet
Author: User

Problem Description: View1 call Startanimation (animation), play animation,

1, assume that View1 animation after the end, View2 also call startanimation (animation); To play the animation

At this point you will find that View2 plays the animation while View1 also plays the animation.

2, assuming the View1 animation is not over, View2 call Startanimation (animation), to play the animation, View2 play the animation at the same time View1 immediately return to the original position of the animation replay.



Solutions

Method One: For different view with different animation objects

Method Two: If View2 play the animation view1 do not need to play the animation, then you can view2 play the animation before you call View1.clearanimation () to clear the View1 animation.

"Android" Two view shared with the same animation object problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.