About the black background issue with activity Toggle Animation (overridependingtransition)

Source: Internet
Author: User

The previous array encountered a Bug. An activity's startup animation needs to be customized to rise from the bottom of the screen. It was written in this way:

StartActivity (New Intent (this, settingactivity_.class)); Overridependingtransition (R.anim.slide_in_from_bottom, 0) ;

The reason why the second parameter in Overridependingtransition is write 0 is that it is only necessary to set the startup animation here. However, the observed result is that when the activity rises, the exposed background is black. This is obviously wrong.

The modification method is:

Overridependingtransition (R.anim.slide_in_from_bottom, R.anim.fake_anim);

Be sure to add the end animation, where the Fake_anim is actually to keep the screen position, what animation does not do. But this ensures that the animation background is switched correctly.

The reason for this is that the second parameter of overridependingtransition (int enteranim, int exitanim) is the end animation of the activity that sets the end. If set to 0, then it will be directly invisible, that becomes black, causing errors.

There is one more solution to this problem, which is to set the subject of the activity and set windowbackground as transparent in the theme. However, this will cause a background transparency error when the activity launches a new activity.

About the black background issue with activity Toggle Animation (overridependingtransition)

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.