Android Animations Fillafter and Fillbefore

Source: Internet
Author: User

Fillbefore is the first frame of the animation at the end of the animation;

Fillafter refers to the end of the animation is the last frame in which the picture stays in this animation.

The Java code is set up as follows:

/***** at the end of the animation, stay at the last frame *********
Setfillafter (TRUE);
Setfillbefore (FALSE);


/***** animation at the end, stay on the first frame *********
Setfillafter (FALSE);
Setfillbefore (TRUE);

The XML settings are as follows:

/****** at the end of the animation, stay at the last frame **********
<set android:fillafter= "true" Android:fillbefore= "false" >


/****** animation at the end, stay on the first frame **********
<set android:fillafter= "false" android:fillbefore= "true" >

Ps:xml settings in the scale label are not valid, note that the set label

Comments

2 floor JAYAAAIII 2012-03-15 Use these two attributes before you set android:fillenabled= "true" to have the effect 1 floor tonyzzp 2011-10-26 Reference I wrote in set, also don't use AH.

Pro-Test:

Stop at the last frame: three lines below to set

Final Animation Mgridviewanim = Animationutils.loadanimation (this, Enteranim? R.anim.item_anim_in:r.anim.item_anim_out);
Mgridviewanim.setfillenabled (TRUE);
Mgridviewanim.setfillafter (TRUE);
Mgridviewanim.setfillbefore (FALSE);
Mgridviewanim.setduration (3000);

Android Animations Fillafter and Fillbefore

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.