cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shazron Abdullah (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CB-4930) InAppBrowser should hide/unhide status bar
Date Tue, 15 Oct 2013 17:02:43 GMT

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

Shazron Abdullah edited comment on CB-4930 at 10/15/13 5:01 PM:
----------------------------------------------------------------

Another method (hides the statusbar) is to implement in the CDVInAppBrowserViewController:

{code}
-(BOOL)prefersStatusBarHidden{
    return YES;
}

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

BUT this only works if your Info.plist value of *UIViewControllerBasedStatusBarAppearance*
is *true* (the default is true if this key/value is missing). The UINavigationController approach
might be best since other plugins might need that value to be false (for example the statusbar
plugin).


was (Author: shazron):
Another method (hides the statusbar) is to implement in the CDVInAppBrowserViewController:

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

BUT this only works if your Info.plist value of *UIViewControllerBasedStatusBarAppearance*
is *true* (the default is true if this key/value is missing). The UINavigationController approach
might be best since other plugins might need that value to be false (for example the statusbar
plugin).

> InAppBrowser should hide/unhide status bar
> ------------------------------------------
>
>                 Key: CB-4930
>                 URL: https://issues.apache.org/jira/browse/CB-4930
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: iOS, Plugin InAppBrowser
>    Affects Versions: 3.0.0
>            Reporter: Shazron Abdullah
>              Labels: ios7
>             Fix For: 3.2.0
>
>
> Right now, the status bar overlaps the IAB at the top.
> Hide the status bar when on iOS 7, unhide (if it was hidden by the user in the first
place for the app only) when it is closed.
> Workaround for now - I suppose you could inject some css to have a body margin-top of
20px (or a different value if it is landscape - yeah it could get messy)
> 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)

Mime
View raw message