首页 > 其他 > 详细

侧边栏效果

时间:2015-08-20 18:26:36      阅读:236      评论:0      收藏:0      [点我收藏+]

appDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
    
    // 侧滑菜单效果
    MRMenu *menu = [[MRMenu alloc] init];
    MRContentViewController *contentVC = [[MRContentViewController alloc] init];
    MRContentNavigationController *contentNavigationController = [[MRContentNavigationController alloc] initWithRootViewController:contentVC];
    
    MVYSideMenuOptions *options = [[MVYSideMenuOptions alloc] init];
    MVYSideMenuController *sideMenuController = [[MVYSideMenuController alloc] initWithMenuViewController:menu contentViewController:contentNavigationController options:options];
    sideMenuController.view.backgroundColor = [UIColor whiteColor];
    // 设置菜单控制器为窗口的跟控制器
    self.window.rootViewController = sideMenuController;
    
    // 设置窗口为主窗口
    [self.window makeKeyAndVisible];
    
    return YES;
}

需要使用一下第三方框架:MVYSideMenu

 

侧边栏效果

原文:http://www.cnblogs.com/yuanjunliang/p/4745719.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!