Pregunta

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.

¿Fue útil?

Solución

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

Otros consejos

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];
    }

Try this in your Target's general settings.

enter image description here

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top