我在iphoneX模拟器上运行我的应用程序并在tabbar下获得了白色空白。有人可以向我解释如何检查这一个。非常感谢。我以编程方式创建了一个tabbar控制器,这是代码。
self.newsfeedVC = [WhatIsNewListVC loadFromNib];
self.messagingVC = [MessagingVC loadFromNib];
self.menuVC = [MenuVC loadFromNib];
self.notiVC = [NotificationVC loadFromNib];
self.iFeedbackMenuStyle2VC = [iFeedbackMenuStyle2VC loadFromNib];
CustomNavigationController *nav1 = [CustomNavigationController loadFromNibWithType:navForWhatIsNew];
[nav1 setViewControllers:@[self.newsfeedVC]];
CustomNavigationController *nav2 = [CustomNavigationController loadFromNibWithType:navForMessaging];
[nav2 setViewControllers:@[self.messagingVC]];
CustomNavigationController *nav3 = [CustomNavigationController loadFromNibWithType:navForDefault];
[nav3 setViewControllers:@[self.notiVC]];
CustomNavigationController *nav4 = [CustomNavigationController loadFromNibWithType:navForDefault];
[nav4 setViewControllers:@[self.iFeedbackMenuStyle2VC]];
CustomNavigationController *nav5 = [CustomNavigationController loadFromNibWithType:navForWhatIsNew];
[nav5 setViewControllers:@[self.menuVC]];
[CAGUserHelper sharedInstance].originalTabVC = [[UITabBarController alloc] init];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"7.0"))
{
[[CAGUserHelper sharedInstance].originalTabVC.tabBar setBarTintColor:[UIColor whiteColor]];
[[CAGUserHelper sharedInstance].originalTabVC.tabBar setTranslucent:NO];
}
[CAGUserHelper sharedInstance].originalTabVC.viewControllers = [NSArray arrayWithObjects:nav1, nav2,nav3,nav4,nav5 ,nil];
NSArray *tabBarItemImages = @[@"i_news.png", @"i_message_tab.png", @"i_notification.png", @"menu_ifeedback.png",@"hamburger_menu.png"];
NSInteger index = 0;
NSArray *titleArr = @[@"News Feed", @"Messages", @"Notifications", @"iFeedback",@"More"];
for (UITabBarItem *item in [[[CAGUserHelper sharedInstance].originalTabVC tabBar] items]) {
// item.badgeValue = @"1";
item.image = [UIImage imageNamed:[tabBarItemImages objectAtIndex:index]];
item.title = titleArr[index];
index++;
}
[CAGUserHelper sharedInstance].originalTabVC.delegate = self;
我将tabbar控制器设置为窗口的根视图控制器,这里是代码。
self.window.rootViewController = [CAGUserHelper sharedInstance].originalTabVC;
答案 0 :(得分:-2)
我找到了答案。这是因为我没有在项目设置中设置任何启动屏幕。非常感谢你的所有答案