在 iphone 的标签栏下有白色间隙
got white gap under tab bar on iphoneX
我是 运行 我在 iphoneX 模拟器上的应用程序,在标签栏下出现了空白。有人可以向我解释如何检查这个。非常感谢。我以编程方式创建了一个标签栏控制器,这是代码。
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;
我将标签栏控制器设置为 window 的根视图控制器,这是代码。
self.window.rootViewController = [CAGUserHelper sharedInstance].originalTabVC;
我找到了答案。这是因为我没有在项目设置中设置任何启动屏幕。非常感谢您的所有回答
我是 运行 我在 iphoneX 模拟器上的应用程序,在标签栏下出现了空白。有人可以向我解释如何检查这个。非常感谢。我以编程方式创建了一个标签栏控制器,这是代码。
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;
我将标签栏控制器设置为 window 的根视图控制器,这是代码。
self.window.rootViewController = [CAGUserHelper sharedInstance].originalTabVC;
我找到了答案。这是因为我没有在项目设置中设置任何启动屏幕。非常感谢您的所有回答