In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly explains "how to achieve the side pop-up window special effect of android". Interested friends may wish to take a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "android how to achieve side pop-up window special effects" bar!
Let's talk about the basic principles first. in fact, it's very simple, it's just a dynamic effect in and out, and it's better to use displacement plus transparency.
For example, if your side pop-up window is on the left, that is 100% from left to right (representing the width or height of the dynamic target)
However, it is important to note:
The initial position must be the last position that should be displayed, do not use Margin or other displacement of the View to other locations, otherwise after the end of the dynamic effect, click on the view does not respond, because the View is still in the initial position, so you click View only animation modified position is invalid, unless you are using attribute animation
Layout:
Then there is the animation file written under res/anim:
Dialog_in.xml:
Dialog_out.xml:
Finally, the code triggers the animation:
Final Animation anim = AnimationUtils.loadAnimation (this, R.anim.dialog_in); anim.setDuration (300); anim.setFillAfter (true); view.startAnimation (anim) Anim.setAnimationListener (new Animation.AnimationListener () {@ Override public void onAnimationStart (Animation animation) {} @ Override public void onAnimationEnd (Animation animation) {/ / be sure to remember that clearing the animation after the animation is over, and then triggering the click over view.clearAnimation () when View is in View.GONE state. } @ Override public void onAnimationRepeat (Animation animation) {}); at this point, I believe you have a better understanding of "how to achieve side pop-up window effects in android", so you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.