1

I have an application with status bar hidden. For hiding status bar I did following things:

  [[UIApplication sharedApplication] setStatusBarHidden:YES];

This was working with ios 6. Now in iOS 7 I added View controller-based status bar appearance = NO. I also created subclass of my navigation controller and added:

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

Everything is working well but when I present UIImagePicker status bar goes visible and than it never hides back even after dismissing view. I also added prefersStatusBarHidden method in the related view too but no success :(

Any help please.

Adrian P
  • 6,479
  • 4
  • 38
  • 55
Kapil Choubisa
  • 5,152
  • 9
  • 65
  • 100

3 Answers3

3

Use following link

- (void)imagePickerController:(UIImagePickerController *)aPicker didFinishPickingMediaWithInfo:(NSDictionary *)info {

// for iOS7
    if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {

        [[UIApplication sharedApplication] setStatusBarHidden:YES];
    }

Following are the list of reference regarding status bar issues in ios7 on stack overflow Itself. ;-)

Status bar and navigation bar appear over my view's bounds in iOS 7

Status bar won't disappear

Status bar appear over my view's bounds in iOS 7

Community
  • 1
  • 1
NIKHIL
  • 2,719
  • 1
  • 26
  • 50
0

Use can use this method for status bar Issue.It should work fine.

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
        UIView *addStatusBar = [[UIView alloc] init];
        addStatusBar.frame = CGRectMake(0, 0, 320, 20);
        addStatusBar.backgroundColor = [UIColor colorWithRed:0.973 green:0.973 blue:0.973 alpha:1]; //change this to match your navigation bar
        [self.window.rootViewController.view addSubview:addStatusBar];
    }
ayon
  • 2,180
  • 2
  • 17
  • 32
  • I want to hide status bar which was hidden already before image picker get presented. I don't want to add some view behind the status bar. – Kapil Choubisa Oct 11 '13 at 04:40
0

Try this in your Target's general settings.

enter image description here

Ankur Arya
  • 4,693
  • 5
  • 29
  • 50