2012-07-07 88 views

回答

0

沒有測試過,有可能是一個更好的辦法,但如果你把你的加載視圖功能如下:

[self performSelector:@selector(hideNavBar) withObject:nil afterDelay:0.0]; 

,然後有這個功能

-(void) hideNavBar { 
    if (self.navigationController.navigationBar.hidden == NO) 
    { 
     [self.navigationController setNavigationBarHidden:YES animated:YES]; 
    } 
} 

你可能有在視圖動畫塊中隱藏導航欄。但有些組合應該工作

退房 link

3

你想UIApplicationsetStatusBarHidden:withAnimation:

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationSlide]; 

the docs

0

在applicationDidBecommeActive(「加載視圖」之後)時,您可以簡單地在AppDelegate中執行此操作。 400毫秒後 設置隱藏狀態,用的UIView動畫塊,並計算你的根視圖控制器的導航欄

// AppDelegate.m 

#import "AppDelegate.h" 
#import "SomeViewController.h" 

@interface AppDelegate() 
@property (nonatomic, strong) SomeViewController *someViewController; 
@end 

@implementation AppDelegate 

- (void)applicationDidBecomeActive:(UIApplication *)application 
{ 
    UINavigationBar *navBar = self.someViewController.navigationController.navigationBar; 
    if (![[UIApplication sharedApplication] isStatusBarHidden]) { 
     [[UIApplication sharedApplication] setStatusBarHidden:YES 
               withAnimation:UIStatusBarAnimationSlide]; 
     [UIView animateWithDuration:0.4 
         animations:^{ 
          navBar.frame = CGRectMake(navBar.frame.origin.x, 0, navBar.frame.size.width, navBar.frame.size.height); 
        } completion:nil]; 
    } 
} 

@end 

就是這樣,「負載視圖(didBecomeActive)後,狀態欄將顯示它會在一段時間後自動隱藏(400毫秒)」

0

你必須選擇你的項目,並選擇Hide during application launch頭一般內,部分Deployment Info這樣的:

enter image description here

並設置的info.plist內View controller-based status bar爲NO:

enter image description here