Mmdrawercontroller use in table view and navigation bar

Source: Internet
Author: User

1. If you are not introducing the Mmdrawercontroller framework in Appdelegate, then be aware of the acquisition of objects in the view controller that needs to be clicked.

Tag View Controller in engineering

Maintabbarviewcontroller *tabbarcontroller = [[maintabbarviewcontroller alloc] init];

// Initialize view Controller

leftdrawcontroller *leftdrawercontroller = [[leftdrawcontroller alloc] init ];//left View

*home = [[homeviewcontroller alloc] init];

newviewcontroller *new = [[newviewcontroller alloc] init];

mapviewcontroller *map = [[mapviewcontroller alloc] init];

moreviewcontroller *more = [[moreviewcontroller alloc] init];//Several main interfaces can have left drawer effect

// store in array

nsarray *array = @[home,new,map,more];

nsmutablearray *navigationarray = [nsmutablearray array];

// Create navigation bar

for(int i = 0; i < array. Count; i + +) {

uinavigationcontroller *nav = [[uinavigationcontroller alloc] Initwithrootviewcontroller: Array[i]];

[Navigationarray addobject: nav];

}

Tabbarcontroller. viewcontrollers = navigationarray;

// Set Center view and Zola view

self. Drawercontroller = [[mmdrawercontroller alloc] initwithcenterviewcontroller: Tabbarcontroller

leftdrawerviewcontroller: Leftdrawercontroller

rightdrawerviewcontroller:nil];

// gesture pull-out, pull-in

[self. Drawercontroller setopendrawergesturemodemask:mmopendrawergesturemodeall];

[self. Drawercontroller setclosedrawergesturemodemask:mmclosedrawergesturemodeall];

// Pull-out width

[self. Drawercontroller setmaximumleftdrawerwidth:350.0];

// give keywindow display

[uiapplication sharedapplication]. Keywindow. Rootviewcontroller = self. Drawercontroller;

2. Implement the navigation bar button in Homeviewcontroller click Open and Close.

1. Introduction of Frame Mmdrawercontroller

2 Acquisition of objects

< span class= "s2" >     mmdrawercontroller  * mmvc = (mmdrawercontroller *) [uiapplication sharedapplication]. Keywindow. Rootviewcontroller

< span class= "s2" >   3 method implementation                            //Right pull

[mmvc toggledrawerside:mmdrawersideleft animated:YES Completion: ^ (BOOL finished) {

}];

Mmdrawercontroller use in table view and navigation bar

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.