Android push-up menu. The two views are displayed on the same screen in the same layout.

Source: Internet
Author: User

Recently I am writing a small application of Baidu map. After all, the screen is so big that it is hard to see how many buttons should be placed on it. Baidu once found that the slide menu is quite good, but Baidu map is sliding by hand. Your sister, these two items are still in conflict. I bought a table last year. As a result, I thought of the push-up menu, and I couldn't use a sliding screen for processing. So I should use a button to stimulate the push-up event. I am a newbie, and I don't know what JB is. I asked the experts in the group to say that I had to use Pan animation. I went to Baidu for half a day and saw that TM was too tall to be used. I accidentally found it in a piece of code.

LinearLayout. LayoutParams lp = new LinearLayout. LayoutParams (LinearLayout. LayoutParams. MATCH_PARENT, LinearLayout. LayoutParams. MATCH_PARENT );

Lp. setMargins (0, 0, 0, 0 );

Menu. setLayoutParams (lp );

After studying this stuff for a while, I finally realized my needs. If I don't talk much about it, I just put the code into my own small breakthrough and put it in my blog to record it.




First, create a layout file, which contains two Linealayout, that is, the main view and menu view used above.


Next we will start to implement the function.



I don't know how many people use this method. I did not implement this function after searching for the Internet for more than half a day. I personally think This is the simplest and easiest way to push menus.





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.