0

I trying to hide the status bar when click on image. I am calling the BOOL Method when click on image by:

    [self prefersStatusBarHidden];

and here the method:

-(BOOL)prefersStatusBarHidden {
    NSLog(@"%@",hideBar);
    if ([hideBar isEqualToString:@"YES"]) {
        NSLog(@"hide");
        return YES;
    }
    return NO;
}

when I click on the image I get the "NSLog("hide")", that mean that the "if statement" is work but the status bar doesn't get hide, what am I doing wrong ?

  • You are not supposed to call the `prefersStatusBarHidden` method directly. It will be called as needed by the system. – rmaddy Oct 04 '14 at 23:03
  • I know but I am trying to hide the status bar when I open image full size, in what other way can I perform it? – user3780061 Oct 04 '14 at 23:11
  • 1
    Look at the docs for `UIApplication`. There are methods for changing the status bar. – rmaddy Oct 04 '14 at 23:12

1 Answers1

0

I found the answer here: stackoverflow.com/questions/18059703 just add in my app's plist file a row - "View controller-based status bar appearance" and set it to NO

and hide the status bar with:

        [[UIApplication sharedApplication] setStatusBarHidden:YES];
Community
  • 1
  • 1