[
https://issues.apache.org/jira/browse/CB-13835?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16374782#comment-16374782
]
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
{code:java}
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;
}
else
{
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];
}
else
{
self.toolbar.hidden = YES;
...
{code}
> iOS InAppBrowser changing toolbar position to top doesn't alter position
> webpage
> --------------------------------------------------------------------------------
>
> Key: CB-13835
> URL: https://issues.apache.org/jira/browse/CB-13835
> 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
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]