Tuesday, January 27, 2015

Hide status bar programmatically with animation


-(void)hideStatusbar{ 

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

      [UIView beginAnimations:@"Statusbar hide" context:nil]; 
      [UIView setAnimationDuration:0.5]; 

      [self.view setFrame:CGRectMake(0, 0, 320, 480)]; 
      [UIView commitAnimations]; 


- (void)viewDidLoad { 
      [super viewDidLoad]; // hideStatusbar called after 2 seconds 
      
      [self performSelector:@selector(hideStatusbar) withObject:nil 
         afterDelay:2.0];

No comments:

Post a Comment