public class Mainactivity extends Slidingfragmentactivity {private slidingmenu slidingmenu; @Overridepublic void OnCreate (Bundle savedinstancestate) {super.oncreate (savedinstancestate);//Full Screen requestwindowfeature (window.feature_ No_title);//Set Content layout Setcontentview (r.layout.content); Set the side Pull entry layout setbehindcontentview (r.layout.menu_frame); Gets the side pull Column object slidingmenu = Getslidingmenu ();//set which way you can pull out of the sidebar//Controls whether the Slidingmenu can be opened with a swipe GE sture.//Options are Touchmode_margin, Touchmode_fullscreen, or touchmode_none//Touchmode_ Example of application scenario for none: when the navigation switches to no need for side pull, set none to//Touchmode_margin drag edge effective//Touchmode_fullscreen Full-screen drag effective slidingmenu.settouchmodeabove (slidingmenu.touchmode_fullscreen);//// Set the content Display page corresponding to the DP size slidingmenu.setbehindoffsetres (R.DIMEN.SLIDINGMENU_OFFSET); Set the left side pull column width, and set the content Display page corresponds, note the unit is px////slidingmenu.setbehindwidth (140),////set the location of the side pull column Left_right Leftslidingmenu.setmode (Slidingmenu.left),////to the side-pull column and the left Content page area (add line) slidingmenu.setshadowdrawable ( R.drawable.shadow); slidingmEnu.setshadowwidthres (R.dimen.shadow_width);
Use of Slidingmenu in Android