IOS drawer effect, ios drawer

Source: Internet
Author: User

IOS drawer effect, ios drawer

Source code download

Download third-party library for drawer Effect

Download third-party class libraries

Side pane drawer


Header file to be imported:

#import "MMDrawerController.h"#import "MMExampleDrawerVisualStateManager.h"
Code implementation:

First, create three controllers

// The main view FirstViewController * firstVC = [[FirstViewController alloc] init]; // The Left view SecondViewController * secondVC = [[SecondViewController alloc] init]; // ThirdViewController * thirdVC = [[ThirdViewController alloc] init]; CustomizedNavigationController * navigationVC = [[CustomizedNavigationController alloc] initWithRootViewController: firstVC]; customizedNavigationController * direction = [[CustomizedNavigationController alloc] direction: secondVC]; CustomizedNavigationController * rightNavigationVC = [[CustomizedNavigationController alloc] initWithRootViewController: thirdVC]; // drawer management third party // This third party can open either the left sidebar or the right sidebar, or both MMDrawerController * rooVC = [[MMDrawerController alloc] initWithCenterViewController: navigationVC navigation: logging rightDrawerViewController: rightNavigationVC]; // only enables opening the left sidebar // MMDrawerController * rooVCLeft = [[MMDrawerController alloc] handler: navigationVC leftDrawerViewController: firstVC]; // open the right column only. // MMDrawerController * rooVCRight = [[MMDrawerController alloc] initWithCenterViewController: navigationVC rightDrawerViewController: thirdVC]; // specify the window Root View self. window. rootViewController = rooVC; // tested the door width [rooVC setMaximumLeftDrawerWidth: 270]; // set the animation for side trim Opening and Closing [rooVC setOpenDrawerGestureModeMask: unlock]; [rooVC trim: MMCloseDrawerGestureModeAll]; // The displayed content is displayed. // sliding left to open the right column [[MMExampleDrawerVisualStateManager sharedManager] setRightDrawerAnimationType: MMDrawerAnimationTypeNone]; // set to slide to the right to open the left sidebar [[sharesharedmanager] role: role]; [rooVC setDrawerVisualStateBlock: ^ (MMDrawerController * drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) {distributed block; block = [[MMExampleDrawerVisualStateManager sharedManager] drawerVisualStateBlockForDrawerSide: drawerSide]; if (block) {block (drawerController, drawerSide, percentVisible) ;}}];





How to Implement drawer interaction menus like Netease iOS clients in ios

Similar to Netease's interactive network, there is a dedicated Demo, PPRevealSideViewController

How does the ios drawer effect determine the external area of the drawer? How to remove help

You can put your drawer in a view to know the Coordinate Position of the current view in your Vc. You can judge that the current view is not available in this area to view the original post>

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.