1.AppDelegate

.h 文件:#import "MMDrawerController .h"

@property (strong, nonatomic) MMDrawerController *drawerController;

.m文件:#improt "LeftViewController.h"

#import "rightViewController.h"

//创建窗口

self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];

self.window.backgroundColor = [UIColor whiteColor];

[self.window makeKeyAndVisible];

//讲ViewController设置导航控制器根视图

UINavigationController *navigation = [[UINavigationController alloc] initWithRootViewController:

[[ViewController alloc] init]];

//初始化左侧和右侧的视图控制器

LeftViewController *leftViewController = [[LeftViewController alloc] init];

RightViewController *rightViewController = [[RightViewController alloc] init];

//滑动的设置:以leftViewController为左滑动,以rightViewController为右滑动

self.drawerController = [[MMDrawerController alloc] initWithCenterViewController:navigation leftDrawerViewController:leftViewController rightDrawerViewController:rightViewController];

//设置左右滑动的宽度

[self.drawerController setMaximumLeftDrawerWidth:360];

[self.drawerController setMaximumRightDrawerWidth:340];

//添加滑动手势

[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];

[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];

//赋予权限

self.window.rootViewController = self.drawerController;

ViewController (视图控制器)

#import "AppDelegate.h"

#define SharApp ((AppDelegate *)[[UIApplication sharedApplication] delegate])  或者(AppDelegate *SharApp =

[UIApplication sharedApplication].delegate;)

//自定义按钮

#pragma mark -右滑动

- (void) rightButtonAction:(UIButton *) button{

[delegate.drawerController toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil];

}

#pragma mark -左滑动

- (void) SearchButtonAction:(UIButton *) button {

[SharApp.drawerController toggleDrawerSide:MMDrawerSideLeft animated:YES completion:nil];

}

#pragma mark -关闭

- (void) exitButtonAction:(UIButton *) button {

if(MMDrawerSideNone){

return ;

}

//[SharApp.drawerController toggleDrawerSide:MMDrawerSideNone animated:YES completion:nil];

[SharApp.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];

}

MMDrawerController 的使用的更多相关文章

  1. MMDrawerController在表视图和导航栏中的使用

    1.如果不在APPDelegate引入MMDrawerController框架,那么就要注意在需要点击的视图控制器中的对象的获取. //工程中标签视图控制器 MainTabBarViewControl ...

  2. MMDrawerController的使用

    1.http://www.jianshu.com/p/9e55cbf7d5ab  MMDrawerController的使用

  3. MMDrawerController第三方库的使用(根据导航item+滚动条progressView实现的手势滑动切换视图的)

    https://github.com/mutualmobile/MMDrawerController MMDrawerControlleris边抽屉导航容器视图控制器用来支持越来越多的应用程序利用抽屉 ...

  4. 第三方MMDrawerController的使用 抽屉视图+(SUNSlideSwitchView)进度条手势滑动效果实现

    下载网站:https://github.com/mutualmobile/MMDrawerController 首先,到下载网址下载MMDrawerController,将文件导入工程,里面有: MM ...

  5. ios开发中超简单抽屉效果(MMDrawerController)的实现

    ios开发中,展示类应用通常要用到抽屉效果,由于项目需要,本人找到一个demo,缩减掉一些不常用的功能,整理出一个较短的实例. 首先需要给工程添加第三方类库 MMDrawerController: 这 ...

  6. MMDrawerController 使用遇到的问题及定制

    MMDrawerController 1,集成UIViewController * leftDrawer = [[UIViewController alloc] init]; UIViewContro ...

  7. MMDrawerController 的实践,已经实现,几行简单的代码实现侧栏

    学习方法,看readme,看给的Demo 看功能怎么实现的去模仿,个人感觉模仿是最快的学习方法 废话少说,上代码 导入MMDrawerController框架我就不多少了,之后做什么才是我们才关注的事 ...

  8. iOS详解MMDrawerController抽屉效果(一)

      提前说好,本文绝对不是教你如何使用MMDrawerController这个第三方库,因为那太多人写了 ,也太简单了.这篇文章主要带你分析MMDrawerController是怎么实现抽屉效果,明白 ...

  9. iOS中 超简单抽屉效果(MMDrawerController)的实现

    ios开发中,展示类应用通常要用到抽屉效果,由于项目需要,本人找到一个demo,缩减掉一些不常用的功能,整理出一个较短的实例. 首先需要给工程添加第三方类库 MMDrawerController: 这 ...

随机推荐

  1. Hibernate <二级缓存>

    二级缓存: 定义: 1.二级缓存被称为进程级缓存或者sessionFactory级缓存,二级缓存可以被所有session共享 2.二级缓存的生命周期和sessionFactory生命周期一样(sess ...

  2. Oracle_双机备份

    1.dataguard http://jingyan.baidu.com/article/f96699bb956ef2894e3c1b39.html http://blog.itpub.net/262 ...

  3. 基于注解的Spring AOP的配置和使用--转载

    AOP是OOP的延续,是Aspect Oriented Programming的缩写,意思是面向切面编程.可以通过预编译方式和运行期动态代理实现在不修改源代码的情况下给程序动态统一添加功能的一种技术. ...

  4. c++ *.h和*.cpp在编译中的作用

    首先,我们可以将所有东西都放在一个.cpp文件内.然后编译器就将这个.cpp编译成.obj,obj是什么东西?就是编译单元了. 一个程序,可以由一个编译单元组成,也可以有多个编译单元组成. 如果你不想 ...

  5. GreenPlum简单性能测试与分析--续

    版权声明:本文由黄辉原创文章,转载请注明出处: 文章原文链接:https://www.qcloud.com/community/article/259 来源:腾云阁 https://www.qclou ...

  6. BitMap存储jpg到手机sd卡中

    /** * 将BitMap转成Jpeg图片保存到sdcard(便于以后debug调试查看和裁切调试) */ private void saveBitmap(Bitmap bitmap, String ...

  7. jquery实现自动滚屏效果,适用用公告新闻等滚屏

    从网络上找到的例子,自己做了下扩展,原示例是向上滚动,扩展了一个向下滚动的方法: <html xmlns="http://www.w3.org/1999/xhtml"> ...

  8. PHP内置函数file_put_content(),将数据写入文件,使用FILE_APPEND 参数进行内容追加

    file_put_contents(fileName,data,flags,context) 入参说明: 参数 说明 fileName 要写入数据的文件名 data 要写入的数据.类型可以是 stri ...

  9. PDF解析

    解析如下图PDF文件 using System; using System.Collections.Generic; using System.Linq; using System.Text; usi ...

  10. jdk6提供的加密算法

    SUN:SHA1PRNG____sun.security.provider.SecureRandomSUN:SHA1withDSA____sun.security.provider.DSA$SHA1w ...