【问题标题】:Navigation Bar Hidden导航栏隐藏
【发布时间】:2012-01-20 23:10:26
【问题描述】:
【问题讨论】:
标签:
ios
xcode
xamarin.ios
uinavigationbar
uitabbar
【解决方案1】:
“模拟指标”顾名思义:“模拟表示”与您将在代码(或 XCode 界面构建器)中创建(或未创建)的任何对象无关。如果您设置将NavigationBar 模拟为黑色或模拟指标中的任何颜色,这对您的实际项目没有任何意义,因为它只是您实际实现它时如何显示的视觉参考。
如果您想拥有一个“真正的”导航顶栏,您必须实现UINavigationController,或手动添加UINavigationBar(通过代码或视觉方式)。
【解决方案2】:
集成标签栏控制器和导航栏控制器的最简单方法是使用代码创建它们。 (这是我最常用的)
//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];
希望对您有所帮助。
干杯