Use of Slidingmenu in Android

Source: Internet
Author: User

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

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.