UINavigationBar
下出現UIStatusBar
在iOS 6中(它正常運行在iOS的7),我使用的分鏡與Xocde 5,UINavigationBar的出現在UIStatusBar
: 這裏是我的代碼片段,
- (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
方法運行我的應用程序被開除,這稱爲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;
}
當我在做什麼錯誤?
在此先感謝。
嗨,我面臨着同樣的問題,在我的應用程序,之後存在於您的視圖控制器 – NANNAV
設定延遲時間我應該在哪裏設置? – Krunal
試試這個 - (void)viewDidLoad { [super viewDidLoad]; [self performSelector:@selector(presentListView)withObject:self afterDelay:0。5]; (void)presentListView { } {CRViewController * Obj = [[CRViewController alloc] init];}};}};}}}} [self.tabBarController presentViewController:Obj animated:YES completion:nil]; } – NANNAV