"Simulated Metrics is as it's name indicates: a "模拟表示“未与您在代码中(或在XCode界面构建器中)创建(或未创建)的任何对象连接 . 如果您将模拟的 NavigationBar 设置为黑色或模拟指标中的任何颜色,对您的实际项目没有任何意义,因为它只是一个视觉参考,如果您实际实现它将如何显示它 .
//Creating the navigation bar
//rVC is some root view controller you have on your code
UINavigationController *nav1 = [[UINavigationController alloc] init];
[nav1 pushViewController:rVC animated:YES];
nav1.navigationBar.barStyle = UIBarStyleBlack;
[rVC release];
//Creating the tab bar custom image and title
UITabBarItem *tab1 = [[UITabBarItem alloc] initWithTitle:@"Nav1" image:[UIImage imageNamed:@"nav1Image.png"] tag:1];
[nav1 setTabBarItem:tab1];
//making the navigation bar visible in the inside tab bar
UITabBarController *tabController = [[UITabBarController alloc] init];
tabController.viewControllers = [NSArray arrayWithObjects:nav1, nil];
2 回答
"Simulated Metrics is as it's name indicates: a "模拟表示“未与您在代码中(或在XCode界面构建器中)创建(或未创建)的任何对象连接 . 如果您将模拟的
NavigationBar
设置为黑色或模拟指标中的任何颜色,对您的实际项目没有任何意义,因为它只是一个视觉参考,如果您实际实现它将如何显示它 .如果你想拥有"real"导航顶部栏,你必须实现
UINavigationController
,或手动添加UINavigationBar
(通过代码或直观) .集成Tab栏Contrller和导航栏控制器的最简单方法是使用代码创建它们 . (这是我大多使用的)
希望它对你有所帮助 . 干杯