Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CB-14024 Take into account statusbar height when toolbar is enabled #265

Closed
wants to merge 1 commit into from

Conversation

humbertuning
Copy link

@humbertuning humbertuning commented Apr 9, 2018

Platforms affected

ios

What does this PR do?

Solves the problem with the webs that are not shown properly when toolbar is enabled on top:

this.browser.create(element.url, '_blank',"toolbar=yes,toolbarposition=top");

What testing has been done on this change?

It was tested on ios devices using the above configuration

Checklist

  • Reported an issue in the JIRA database
  • Commit message follows the format: "CB-3232: (android) Fix bug with resolving file paths", where CB-xxxx is the JIRA ID & "android" is the platform affected.
  • Added automated test coverage as appropriate for this change.

@sin-tanaka
Copy link

This PR worked on my device(ver. iOS 11.3)
Im glad to be merged this PR as soon as possible, because we are using this plugin :)

@svanzoest
Copy link

The travis failure is a timeout, which seems like it wouldn't be related to this PR.

@hvaughan3
Copy link

hvaughan3 commented Aug 3, 2018

Forked and pulled in this PR. It does indeed push the content below the status bar but it also cuts off the content at the bottom by the same amount. You should also subtract the webview height by the status bar height to prevent it. Something like:

[self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT + [self getStatusBarOffset], self.webView.frame.size.width, self.webView.frame.size.height - [self getStatusBarOffset])];

@de-dan
Copy link

de-dan commented Sep 7, 2018

I tested this PR with @hvaughan3's changes. Works beautifully. The Travis CI build fails on Android platform?? This can be ignored in my opinion as there are no changes for android.

Copy link

@de-dan de-dan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As @hvaughan3 suggested, use this line to consider location bar:
[self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT + [self getStatusBarOffset], self.webView.frame.size.width, self.webView.frame.size.height - [self getStatusBarOffset])];

@janpio
Copy link
Member

janpio commented Oct 1, 2018

Hey, I just fixed the problem that caused Android tests to fail in master. Could you rebase this PR please? This should get rid of the Android failures and possibly fix all test failures for this PR.

@janpio
Copy link
Member

janpio commented Oct 3, 2018

Closing to retrigger CI.

@janpio janpio closed this Oct 3, 2018
@janpio janpio reopened this Oct 3, 2018
@lovelyelfpop
Copy link

lovelyelfpop commented Dec 13, 2018

On iphoneX

for [self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT + [self getStatusBarOffset], self.webView.frame.size.width, self.webView.frame.size.height)];,
the webview is out of the screen at the bottom, it seems the webview's height is 20px higher than it should be.

for [self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT + [self getStatusBarOffset], self.webView.frame.size.width, self.webView.frame.size.height - [self getStatusBarOffset])];,
it leaves 20px grey area at the bottom, the webview's height is 20px shorter than it should be.

Could it be [self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT + [self getStatusBarOffset], self.webView.frame.size.width, self.webView.frame.size.height - [self getStatusBarOffset] + STATUSBAR_HEIGHT)];, because the viewbounds height is subtracted by STATUSBAR_HEIGHT in viewWillApear?

@cleitonjar
Copy link

It worked!

@jacobg
Copy link

jacobg commented Feb 11, 2020

Any update on this? I needed to edit CDVWKInAppBrowser.m in the rePositionViews method, to add + [self getStatusBarOffset] to the webView y point

That is, this line of code:

[self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT, self.webView.frame.size.width, self.webView.frame.size.height)];

should instead be:

       [self.webView setFrame:CGRectMake(self.webView.frame.origin.x, TOOLBAR_HEIGHT + [self getStatusBarOffset], self.webView.frame.size.width, self.webView.frame.size.height)];

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ☠️ Closed/Abandoned
Development

Successfully merging this pull request may close these issues.

10 participants