0

getting strange issue in iOS 8

i have made made

  1. View controller-based status bar appearance is NO in info.plist file

  2. implemented following methods

    -(void)navigationController:(UINavigationController *)navigationController
     willShowViewController:(UIViewController *)viewController
                   animated:(BOOL)animated
    {
       [[UIApplication sharedApplication] setStatusBarHidden:YES];
    }
    
    -(BOOL)prefersStatusBarHidden;
    {
       return YES;
    }
    

the problem is when i navigate to photo gallery at time status bar is hidden , but after dismissing it , status bar became visible for entire app .

Thanks.

Shaik Riyaz
  • 11,204
  • 7
  • 53
  • 70
  • http://stackoverflow.com/questions/18880364/uiimagepickercontroller-breaks-status-bar-appearance – iBhavin Nov 03 '14 at 06:25
  • @iBhavin i tried that , but no luck – Shaik Riyaz Nov 03 '14 at 06:43
  • @bhavin that question is just for setting statusbar hidden or not. but he has issue with image picker. Because image picker will turn on the status bar we need to manually hide it on view will appear. – hardik hadwani Nov 03 '14 at 06:45

2 Answers2

2

You need to hide status bar in view will apear of the class in which you are calling imagepicker using below code.

[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
hardik hadwani
  • 556
  • 6
  • 24
2

From Plist

Status bar initially hidden Select YES

ViewController Based Status bar Set to NO. it will work the trick.

Logic
  • 705
  • 1
  • 9
  • 27
  • this will work for app but when you open image picker it will show statusbar, even after closing image picker view.. – hardik hadwani Nov 19 '14 at 04:27
  • this [[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO]; and above works together – Logic Nov 21 '14 at 07:24