Remove status bar when the iOS device is landscape orientation


/ Published in: Objective C
Save to your folder(s)



Copy this code and paste it in your HTML
  1. -(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
  2. {
  3. if (toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft||UIInterfaceOrientationLandscapeRight) {
  4. [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:UIStatusBarAnimationFade];
  5. }
  6. if (toInterfaceOrientation == UIInterfaceOrientationPortrait) {
  7. [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationFade];
  8. }
  9.  
  10. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.