You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "Shazron Abdullah (JIRA)" <ji...@apache.org> on 2013/10/15 19:02:44 UTC

[jira] [Comment Edited] (CB-4958) Camera plugin should hide/unhide status bar

    [ https://issues.apache.org/jira/browse/CB-4958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13795378#comment-13795378 ] 

Shazron Abdullah edited comment on CB-4958 at 10/15/13 5:02 PM:
----------------------------------------------------------------

A fix is to is to make sure your Info.plist value of UIViewControllerBasedStatusBarAppearance is false (the default is true if this key/value is missing). This might not be best if other plugins might need that value to be true.

The fix that works whether that key is set to any value is, to implement this in CDVCameraPicker:
{code}
-(BOOL)prefersStatusBarHidden{
    return YES;
}

- (UIViewController *)childViewControllerForStatusBarHidden {
    return nil;
}
    
-(void)viewWillAppear:(BOOL)animated {
    SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
    if ([self respondsToSelector:sel]) {
        [self performSelector:sel withObject:nil afterDelay:0];
    }
    
    [super viewWillAppear:animated];
}
{code}


was (Author: shazron):
A fix is to is to make sure your Info.plist value of UIViewControllerBasedStatusBarAppearance is false (the default is true if this key/value is missing). This might not be best if other plugins might need that value to be true.

The fix that works whether that value is set to any value is, to implement this in CDVCameraPicker:
{code}
-(BOOL)prefersStatusBarHidden{
    return YES;
}

- (UIViewController *)childViewControllerForStatusBarHidden {
    return nil;
}
    
-(void)viewWillAppear:(BOOL)animated {
    SEL sel = NSSelectorFromString(@"setNeedsStatusBarAppearanceUpdate");
    if ([self respondsToSelector:sel]) {
        [self performSelector:sel withObject:nil afterDelay:0];
    }
    
    [super viewWillAppear:animated];
}
{code}

> Camera plugin should hide/unhide status bar
> -------------------------------------------
>
>                 Key: CB-4958
>                 URL: https://issues.apache.org/jira/browse/CB-4958
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS, Plugin Camera
>    Affects Versions: 3.0.0
>            Reporter: Shazron Abdullah
>              Labels: ios7
>             Fix For: 3.2.0
>
>
> Right now, the status bar overlaps the Camera at the top.
> Hide the status bar when on iOS 7, unhide (if it was not hidden by the user in the first place for the app only) when it is closed.
> Hiding/unhiding the status bar is preferable to moving the view down to be consistent with the UIWebView taking up the whole window.



--
This message was sent by Atlassian JIRA
(v6.1#6144)