UINavigationBar
在 iOS 6 中出现UIStatusBar
(它在 iOS 7 中正常运行),我正在使用带有 Xocde 5 的情节提要,
: 这是我的代码片段,
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[UIApplication sharedApplication].statusBarHidden = NO;
if ([[[UIDevice currentDevice] systemVersion] floatValue] < 7) //iOS 6
{
[[UITabBar appearance] setBackgroundImage:[UIImage imageNamed:@"TabImg.png"]];
[[UINavigationBar appearance] setTintColor:[UIColor colorWithRed:.7 green:.2 blue:.1 alpha:1.0]];
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleBlackOpaque];
}
return YES;
}
主页上的代码,
- (void)viewDidLoad
{
[super viewDidLoad];
CRViewController *Obj=[[CRViewController alloc] init];
[self.tabBarController presentViewController:Obj animated:YES completion:nil];
}
didFinishLaunchingWithOptions
当我在方法viewDidLoad
被触发并调用CRViewController
类之后运行我的应用程序时。
上代码CRViewController
,
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationController setNavigationBarHidden:YES];
self.tabBarController.tabBar.hidden = YES;
[UIApplication sharedApplication].statusBarHidden = YES;
...
...
...
}
- (IBAction)SkipClick:(id)sender {
[self dismissViewControllerAnimated:YES completion:nil];
}
-(void)viewDidDisappear:(BOOL)animated{
[self.navigationController setNavigationBarHidden:NO];
self.tabBarController.tabBar.hidden = NO;
[UIApplication sharedApplication].statusBarHidden = NO;
}
我在哪里做错了?
提前致谢。