Android sliding Menu Special effects, imitation of the client side sideslip effect, the history of the most simple sideslip implementation

Source: Internet
Author: User

Everyone client has a special effect is still very attractive, the main interface fingers slide right, you can show the menu, and the main screen will be hidden most, but still a small part of the left side with the menu to display.

It is said that this special effect is copied from Facebook clients, and it is not known whether Facebook has copied it from elsewhere. OK, today we will work together to achieve this effect, anyway, I first saw this special effect is in the client to see, I also subjectively think I am in imitation of the special effects of everyone client.

Although the implementation of the online similar effect is very much, but I found that the implementation of the solution is very complex, not easy to understand. But in fact this effect is not difficult to achieve, so I bring you today is also the history of the simplest sliding menu implementation scheme.

First, let's talk about the principle of implementation. There are two parts in the layout of an activity, one is the layout of the menu, the other is the layout of content. Two layouts are arranged horizontally, the menu layout is on the left, and the content layout is on the right. When initialized, the menu layout is shifted to the left so that it is completely hidden so that the content layout is fully displayed in the activity. Then, by listening to the finger sliding events, the left offset distance of the menu layout is changed to control the display and hiding of the menu layout. The schematic diagram is as follows:

Change the left offset value of the menu layout to 0 o'clock and the effect is as follows:

Related Article

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.