Skip to content

Instantly share code, notes, and snippets.

@tinkertims
Created June 10, 2016 12:06
Show Gist options
  • Save tinkertims/3ea0bf7d2f677a723cb7aaa5c9e333c2 to your computer and use it in GitHub Desktop.
Save tinkertims/3ea0bf7d2f677a723cb7aaa5c9e333c2 to your computer and use it in GitHub Desktop.
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];
}
@tinkertims
Copy link
Author

Just assume I got all of them from here: https://jayprakashdubey.blogspot.in/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment