UISplitViewController & UINavigationController SplitView Navigation iOS 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 苹果本身就不允许你将uisplitviewcontroller去push到uinavigationcontroller 中。参考:http://stackoverflow.com/questions/6855454/how-can-we-push-uisplitviewcontroller-to-a-uinavigationcontroller 我通过Storyboard可以做到。只是不明白为什么不能通过程序实现。 Storyboard 拖拽一个UINavigationController 作为起点,设置它的RootViewController为自己的PHMessagingSplitViewController就可以了。 在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; //PHMessagingSplitViewController is a subclass of UISplitViewController PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC; [self.window makeKeyAndVisible]; return YES;} 在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; //PHMessagingSplitViewController is a subclass of UISplitViewController PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC; [self.window makeKeyAndVisible]; return YES;}谢谢你的回复。不过我需要在最顶部显示NavigationBar。所以必须要用UINavigationController. 在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; //PHMessagingSplitViewController is a subclass of UISplitViewController PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC; [self.window makeKeyAndVisible]; return YES;}谢谢你的回复。不过我需要在最顶部显示NavigationBar。所以必须要用UINavigationController.UISplitViewController 应该也是一个容器controller,左边的是Master, 右边的是Deitail. 指定Master和Detail 对应的控制器均为UINavigationController 不就可以了吗 ? 在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.window.backgroundColor = [UIColor whiteColor]; //PHMessagingSplitViewController is a subclass of UISplitViewController PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC; [self.window makeKeyAndVisible]; return YES;}谢谢你的回复。不过我需要在最顶部显示NavigationBar。所以必须要用UINavigationController.UISplitViewController 应该也是一个容器controller,左边的是Master, 右边的是Deitail. 指定Master和Detail 对应的控制器均为UINavigationController 不就可以了吗 ?最顶部显示,在Master Detail里面我不需要显示各自NavigationBar的。 不过我已经用Storyboard实现了。只是不知道为什么Storyboad可以做,而程序中不可以。 ios证书管理模式 求助啊为什么我的ipa同步在ipad上安装失败 关于IOS的几个小白问题,求解 iOS 蓝牙通讯不需要MFi认证方式 IOS多人协作开发的解决方案? ios 程序不能运行 ios如何提取网页中的信息 怎么把图片格式转换? UITableView的问题 关于导航栏自带返回手势返回时遇到的问题 企业账号,打包ipa 怎么打包出来,只有测试机能用,是怎么回事?求大神啊 PhoneGap设置开始页面
参考:http://stackoverflow.com/questions/6855454/how-can-we-push-uisplitviewcontroller-to-a-uinavigationcontroller
在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
//PHMessagingSplitViewController is a subclass of UISplitViewController
PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC;
[self.window makeKeyAndVisible];
return YES;
}
在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
//PHMessagingSplitViewController is a subclass of UISplitViewController
PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC;
[self.window makeKeyAndVisible];
return YES;
}谢谢你的回复。不过我需要在最顶部显示NavigationBar。所以必须要用UINavigationController.
在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
//PHMessagingSplitViewController is a subclass of UISplitViewController
PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC;
[self.window makeKeyAndVisible];
return YES;
}谢谢你的回复。不过我需要在最顶部显示NavigationBar。所以必须要用UINavigationController.UISplitViewController 应该也是一个容器controller,左边的是Master, 右边的是Deitail. 指定Master和Detail 对应的控制器均为UINavigationController 不就可以了吗 ?
在AppDelegate.h中, 将uisplitviewcontroller作为uiwindow的rootviewcontroller .如下:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.window.backgroundColor = [UIColor whiteColor];
//PHMessagingSplitViewController is a subclass of UISplitViewController
PHMessagingSplitViewController *tmpVC = [[PHMessagingSplitViewController alloc] init]; self.window.rootViewController =tempVC;
[self.window makeKeyAndVisible];
return YES;
}谢谢你的回复。不过我需要在最顶部显示NavigationBar。所以必须要用UINavigationController.UISplitViewController 应该也是一个容器controller,左边的是Master, 右边的是Deitail. 指定Master和Detail 对应的控制器均为UINavigationController 不就可以了吗 ?最顶部显示,在Master Detail里面我不需要显示各自NavigationBar的。