2012-07-07 54 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