如何为ipad实现RESideMedu?

时间:2014-08-05 05:16:58

标签: ios ipad xib

我已将RESidemenu纳入我的项目中。我正在创建iPhone和iPad xib,但只有iPhone xib正在运行。如何将iPad xib添加到RESidemenu

任何人都知道......提前感谢...

1 个答案:

答案 0 :(得分:0)

您可以使用以下在我的项目中使用的代码

DEMOLeftMenuViewController *leftMenuViewController;
    DEMORightMenuViewController *rightMenuViewController;
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:[[DEMOFirstViewController alloc] init]];

    if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone){
        leftMenuViewController = [[DEMOLeftMenuViewController alloc] initWithNibName:@"DEMOFirstViewController_iphone" bundle:nil];
        rightMenuViewController = [[DEMORightMenuViewController alloc] initWithNibName:@"DEMORightMenuViewController_iphone" bundle:nil];

    }else{
        leftMenuViewController = [[DEMOLeftMenuViewController alloc] initWithNibName:@"DEMOFirstViewController_ipad" bundle:nil];
         rightMenuViewController = [[DEMORightMenuViewController alloc] initWithNibName:@"DEMORightMenuViewController_ipad" bundle:nil];

    }

    RESideMenu *sideMenuViewController = [[RESideMenu alloc] initWithContentViewController:navigationController
                                                                    leftMenuViewController:leftMenuViewController
                                                                   rightMenuViewController:rightMenuViewController];
    sideMenuViewController.backgroundImage = [UIImage imageNamed:@"Stars"];
    sideMenuViewController.menuPreferredStatusBarStyle = 1; // UIStatusBarStyleLightContent
    sideMenuViewController.delegate = self;
    sideMenuViewController.contentViewShadowColor = [UIColor blackColor];
    sideMenuViewController.contentViewShadowOffset = CGSizeMake(0, 0);
    sideMenuViewController.contentViewShadowOpacity = 0.6;
    sideMenuViewController.contentViewShadowRadius = 12;
    sideMenuViewController.contentViewShadowEnabled = YES;
    self.window.rootViewController = sideMenuViewController;