【发布时间】:2017-01-05 09:31:29
【问题描述】:
错误:“不鼓励在分离的视图控制器上显示视图控制器。”
HomeView *objHomeView = [[HomeView alloc] initWithNibName:@"HomeView" bundle:nil];
objNav = [[UINavigationController alloc] initWithRootViewController:objHomeView];
[[UINavigationBar appearance] setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor]}];
NSArray *controllers = [NSArray arrayWithObject:objHomeView];
self.sideMenu.navigationController.viewControllers = controllers;
self.window.rootViewController = [self sideMenu].navigationController;
[window makeKeyAndVisible];
【问题讨论】:
-
能否添加您尝试过的代码
-
在您展示视图控制器时的代码中?看来您只是在设置rootviewcontroller。
-
thanx @KetanParmar 但我已经将 rootviewcontroller 设置为 myhome 视图。
-
我得到了解决方案,谢谢
-
如果你得到了解决方案,你能在下面添加答案吗?
标签: ios iphone ios9 mfslidemenu