iOS 自定义抽屉式效果--ViewDeck(SlidingDrawer)实现与使用详解

本实现抽屉式效果的框架相对gitHub里的IIViewDeck,更加简单易用,实现代码简单,效果好,可以无需修改原项目的任何框架而将本效果无缝式移植进现有的项目中,具体操作如下。

1.首先,上demo代码:下载

2.Xcode打开项目,可以看到RootViewController,LeftViewController,RightViewController,CenterViewController等,在移植过程中,只需把这四个控制器文件及UIImage+ImageEffects这个分类拖入项目中,然后重写程序代理的完成加载方法(或者其他必要的地方)即可,重写代码如下:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    self.window.backgroundColor = [UIColor whiteColor];
    
    CenterViewController *centerVC = [[CenterViewController alloc] init];
    LeftViewController *leftVC = [LeftViewController new];
    RightViewController *rightVC = [RightViewController new];
    
    self.window.rootViewController = [[RootViewController alloc] initWithCenterVC:centerVC rightVC:rightVC leftVC:leftVC];
    [self.window makeKeyAndVisible];
    return YES;
}

3.此时编译项目即可实现如下的效果:

  

4.修改RootViewController,LeftViewController,RightViewController,CenterViewController,实现对应的界面及功能。

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值