Mmdrawercontroller Drawer Sidebar Use example code

Source: Internet
Author: User

The method should be placed in the Appdelegate
-(void) Tomain
{
Initializing the Central view VC
[Self tabbarcontrollerinit];
Initialize left column Drawer view VC
Alranklistviewcontroller *leftviewcontroller = [[Alranklistviewcontroller alloc] Initwithnibname:nil Bundle:nil];
Set Drawer View VC
Self.mmdrawcontroller = [[Mmdrawercontroller alloc] Initwithcenterviewcontroller:_tabbarviewcontroller Leftdrawerviewcontroller:leftviewcontroller];
Set the drawer view VC function
//---------------------------------------------------------------------------------------------//
Set left View VC width
[Self.mmdrawcontroller Setmaximumleftdrawerwidth:kmaximumleftdrawerwidth];
Set left view VC open mode
[Self.mmdrawcontroller Setopendrawergesturemodemask:mmopendrawergesturemodeall];
Set left view VC off mode
[Self.mmdrawcontroller Setclosedrawergesturemodemask:mmclosedrawergesturemodeall];
Set Drawer view VC Shadow Effect
Self.mmDrawController.showsShadow = YES;
Set right swipe to open left column
[Mmexampledrawervisualstatemanager sharedmanager].leftdraweranimationtype = mmdraweranimationtypeslide;
Set the visualization status of the drawer VC?
[Self.mmdrawcontroller Setdrawervisualstateblock:
^ (Mmdrawercontroller *drawercontroller,
Mmdrawerside Drawerside,
CGFloat percentvisible)
{
Mmdrawercontrollerdrawervisualstateblock Block;
block = [[Mmexampledrawervisualstatemanager Sharedmanager]
Drawervisualstateblockfordrawerside:drawerside];
if (block) {
Block (Drawercontroller, drawerside, percentvisible);
}
}];
//---------------------------------------------------------------------------------------------//
Set the drawer view VC to the root VC.
Self.window.rootViewController = _mmdrawcontroller;

}



Mmdrawercontroller Drawer Sidebar Use example code

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.