iOS抽屉效果
2016-04-14 16:37
615 查看
源代码下载
抽屉效果第三方类库下载
所需第三方类库下载
側拉栏抽屉效果图
须要导入的头文件:
首先须要创建三个试图控制器
抽屉效果第三方类库下载
所需第三方类库下载
側拉栏抽屉效果图
须要导入的头文件:
#import "MMDrawerController.h" #import "MMExampleDrawerVisualStateManager.h"代码实现:
首先须要创建三个试图控制器
//主视图 FirstViewController *firstVC = [[FirstViewController alloc] init]; //左边视图 SecondViewController *secondVC = [[SecondViewController alloc] init]; //右边视图 ThirdViewController *thirdVC = [[ThirdViewController alloc] init]; CustomizedNavigationController *navigationVC = [[CustomizedNavigationController alloc] initWithRootViewController:firstVC]; CustomizedNavigationController *leftNavigationVC = [[CustomizedNavigationController alloc] initWithRootViewController:secondVC]; CustomizedNavigationController *rightNavigationVC = [[CustomizedNavigationController alloc] initWithRootViewController:thirdVC]; //抽屉管理 第三方 //该第三方既能够仅仅实现打开左側栏也能够实现打开右側栏,还能够同一时候都实现 MMDrawerController *rooVC = [[MMDrawerController alloc] initWithCenterViewController:navigationVC leftDrawerViewController:leftNavigationVC rightDrawerViewController:rightNavigationVC]; //仅仅实现打开左側栏 //MMDrawerController *rooVCLeft = [[MMDrawerController alloc] initWithCenterViewController:navigationVC leftDrawerViewController:firstVC]; //仅仅实现打开右側栏 //MMDrawerController *rooVCRight = [[MMDrawerController alloc] initWithCenterViewController:navigationVC rightDrawerViewController:thirdVC]; //指定window的根视图 self.window.rootViewController = rooVC; //測了门的宽度 [rooVC setMaximumLeftDrawerWidth:270]; //设置側拉门开与关的动画 [rooVC setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll]; [rooVC setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll]; //側开内容展示效果 //设置向左滑动打开右側栏 [[MMExampleDrawerVisualStateManager sharedManager] setRightDrawerAnimationType:MMDrawerAnimationTypeNone]; //设置向右滑动打开左側栏 [[MMExampleDrawerVisualStateManager sharedManager] setLeftDrawerAnimationType:MMDrawerAnimationTypeNone]; [rooVC setDrawerVisualStateBlock:^(MMDrawerController *drawerController, MMDrawerSide drawerSide, CGFloat percentVisible) { MMDrawerControllerDrawerVisualStateBlock block; block = [[MMExampleDrawerVisualStateManager sharedManager] drawerVisualStateBlockForDrawerSide:drawerSide]; if(block){ block(drawerController, drawerSide, percentVisible); } }];
相关文章推荐
- tableView相关
- IOS NSString 字符串处理:截取字符串、匹配字符串、分隔字符串
- iOS block
- iOS - 项目加密处理
- iOS CADisplayLink 使用WSYFPSLabel监测程序FPS
- 谈谈入门iOS的经验吧
- iOS开发 GET、POST请求方法(NSURLSession篇)
- ios 内置支付宝
- iOS 通知 代理 block
- iOS 记录之 CocoaPods Pods的制作(新版方式)
- 申请iOS开发者账号遇到的一些坑
- iOS:键盘弹出和收起的通知使用
- iOS开发中有关图片裁切的问题
- ios 定时器不同的工作模式
- ios 保留子线程不退出可以继续执行任务
- iOS开发--调试必备 — NSLog
- iOS开发--计时器-NSTimer与CADisplayLink
- Xcode编译错误_Offsetof
- iOS原生的AVFoundation扫描二维码/条形码
- 漫谈iOS RSA非对称加密与解密