iOS抽屉效果
ios 效果 抽屉
2023-09-14 09:10:06 时间
抽屉效果第三方类库下载
側拉栏抽屉效果图
须要导入的头文件:
#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); } }];
相关文章
- (NO.00001)iOS游戏SpeedBoy Lite成形记(二十二)
- (NO.00001)iOS游戏SpeedBoy Lite成形记(五)
- IOS 接ShareSDK问题
- IOS 提交审核,遇到Missing Push Notification Entitlement 问题。
- 自己整理的ios app实现自动升级
- IOS学习资源收集--关于动画的代码学习资源总汇(很棒的动画效果哦)
- 【IOS-COCOS2D游戏开发之十四】音频/音效/视频播放(利用COCOS2D-IPHONE-EXTENSIONS嵌入COCOS2D进行视频播放!)
- 在Windows笔记本上调试运行在iOS设备上的前端应用
- ios swift5 UIImage和Data互转 通过url获取本地图片
- iOS swift swiftUI 适配黑暗(暗黑)模式
- iOS swift5 oc 高斯模糊 毛玻璃效果
- iOS Block的内存管理
- CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler(cordova build ios报错)
- Android 11.0 12.0仿ios的hotseat效果修改hotseat样式
- Android 9.0 仿ios的hotseat效果修改hotseat样式
- Android 仿ios实现app列表图标长按实现抖动效果
- Android 10.0 仿ios的hotseat效果修改hotseat样式
- 【iOS发展-81】setNeedsDisplay刷新显卡,并CADisplayLink它用来模拟计时器效果
- UIControl-IOS发展
- iOS 自己主动登录,登录过程中一直显示载入页
- IOS获取来电去电来电归属系统通知达到效果(一)
- iOS得知1_初体验