Search code examples
iosxcodestatusbar

How to hide status bar when displaying tutorial pages in iOS7?


I followed the link How To Create UIPageViewController Using Storyboard to show the tutorial pages when my app is first installed or updated. Since I don't think it is fine to show status bar when showing these pages, I want to hide them during tutorial pages and show them again in main view controller. I have set the status bar to None of the PageViewController in the storyboard, but it is not working. Also I have tried to add the following code mentioned in some posts to PageContentViewController.m file. However, it does not work either.

- (BOOL)prefersStatusBarHidden {
    return YES;
}

Does anyone know how to solve it? Thank you very much!


Solution

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