cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Saul (JIRA)" <>
Subject [jira] [Commented] (CB-13835) iOS InAppBrowser changing toolbar position to top doesn't alter position webpage
Date Fri, 23 Feb 2018 18:16:00 GMT


Tom Saul commented on CB-13835:

I am not familiar with this development framework, but I suspect I see the problem(s) in the
source code.  The first is that is is assuming the statusBar is present (not guaranteed),
and is a fixed height (line 30 - #define    STATUSBAR_HEIGHT 20.0) - the height is no longer
fixed in IOS (it can vary on iPhone 10), so this would need to be factored in.  The second
issue is in the showToolBar method (line 735).  For clarity I would suggest reorganizing
this where the top level block is a test for bar position (top or bottom).  The location
bar is not relevant for when this is at the top, and the logic will get a bit convoluted as-is. 
Perhaps something like

if (show)
    self.toolbar.hidden = NO;
    CGRect webViewBounds = self.view.bounds;

    int statusBarSize = getStatusBarSize(); // Note this needs to reflect the actual size,
not a constant.  Could be zero, the old fixed size, of the new iPhone 10 size
    webViewBounds.size.height -= TOOLBAR_HEIGHT;
    if ([toolbarPosition isEqualToString:kInAppBrowserToolbarBarPositionTop])
        toolbarFrame.origin.y = statusBarSize;  
        webViewBounds.origin.y += toolbarFrame.size.height + statusBarSize;
        if (locationbarVisible)
            webViewBounds.size.height -= LOCATIONBAR_HEIGHT;
            locationbarFrame.origin.y = webViewBounds.size.height;
            self.addressLabel.frame = locationbarFrame;
        } else
            CGRect webViewBounds = self.view.bounds;
        toolbarFrame.origin.y = (webViewBounds.size.height + LOCATIONBAR_HEIGHT);
    self.toolbar.frame = toolbarFrame;
    [self setWebViewFrame:webViewBounds];

    self.toolbar.hidden = YES;

> iOS InAppBrowser changing toolbar position to top doesn't alter position webpage
> --------------------------------------------------------------------------------
>                 Key: CB-13835
>                 URL:
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-plugin-inappbrowser
>            Reporter: Corneel den Hartogh
>            Priority: Major
>         Attachments: Screenshot 2018-01-26 11.25.02.jpg, Screenshot 2018-01-26 11.28.24.jpg
> Within the InAppBrowser  you can set for iOS the toolbarposition on bottom or top (bottom
is default). When I make it top, the position of the loaded url (a map in my case) isn't changed.
The result is that the toolbar is in front of the url (where the search box is blocked out
of view as can be seen in the screenshots). 
> I updated Ionic / Cordova / InAppBrowser but it didn't change anything.
> I tried some workaround myself but I was unable to figure it out. Any suggestions here?

This message was sent by Atlassian JIRA

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message