Android imitation Renren sliding sidebar effect
In order to save space and display sufficient information on the interface, most applications use the sidebar, as shown in the following figure:
For its idea, the bottom is two or more views. Control their display by controlling their width and left margin to see the code
activity_ main. xml
MainActivity. java
The above code only uses two pictures instead of two complex views (layouts). You will find that although the two views can be switched, they do not have the feeling of animation. In addition, there should be a drag effect. Therefore, we add a translation time period to it, which seems to have the effect of animation
The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.