如何为 ipad 实现 RESideMedu?
Posted
技术标签:
【中文标题】如何为 ipad 实现 RESideMedu?【英文标题】:how to implement RESideMedu for ipad? 【发布时间】:2014-08-05 05:16:57 【问题描述】:我已将RESidemenu
包含在我的项目中。我正在创建 iPhone 和 iPad xib,但只有 iPhone xib 正在运行。如何将 iPad xibs 添加到RESidemenu
?
任何人都知道....提前谢谢...
【问题讨论】:
【参考方案1】:您可以在我的项目中使用以下代码
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;
【讨论】:
我在问如何在 [self.sideMenuViewController setContentViewController:[[UINavigationController alloc] initWithRootViewController:[[WPoverview alloc] init]]animated:YES] 中添加内部页面; 将其设置为 NSString *strNibname; if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) strNibname=@"WPoverview_iphone"; // 此处设置 iphone 笔尖名称 else strNibname=@"WPoverview_ipad"; // 这里设置ipad nib name [self.sideMenuViewController setContentViewController:[[UINavigationController alloc] initWithRootViewController:[[WPoverview alloc] initWithNibName:strNibname bundle:nil]]animated:YES];以上是关于如何为 ipad 实现 RESideMedu?的主要内容,如果未能解决你的问题,请参考以下文章