Recently in a Baidu map to write a small application, after all, the screen is so big, to put a few buttons on top, how the layout is ugly. Baidu a bit, found that the side-slide menu is good, Baidu map is to use the hand slippery Ah, your sister, these two things actually also conflict, I bought a watch last year. So, think of the push menu, can not use the slide screen to handle, then use a button to stimulate the push event bar. Because it is a novice what jb things do not understand, ask the group of big, say with translation animation, I also Baidu a half-day a look TM too tall on, with bad. Accidentally found 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);
This thing, carefully pondering a night, finally is to achieve my needs, words not to say, put code, is a small breakthrough, put blog to remember.
First create a layout file that contains two linealayout, which is the main view and menu views used above
The next step is to implement the function.
do not know how many people use this method, anyway, I found on the internet for a large half-day has not realized this function, the individual think is the simplest, most understandable push menu.