You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/12/13 01:34:38 UTC

[GitHub] lovelyelfpop opened a new issue #374: Webview offset and height issue on ios when `toolbarposition=top`

lovelyelfpop opened a new issue #374: Webview offset and height issue on ios when `toolbarposition=top`
URL: https://github.com/apache/cordova-plugin-inappbrowser/issues/374
 
 
   When `toolbarposition=top` on ios, the body was covered by the webview at the top, it's the default behavior for this plugin.
   ![0](https://user-images.githubusercontent.com/5656924/49909493-2ef54c00-feba-11e8-9ae4-5625cdb86080.jpg)
   
   
   Then is found this [pull request](https://github.com/apache/cordova-plugin-inappbrowser/pull/265), change the `rePositionViews` function would sove this problem, but it leads to a new one. 
   
   On iphoneX, the webview is out of the screen at the bottom, it seems the webview's height is 20px higher than it should be.
   ![1](https://user-images.githubusercontent.com/5656924/49909497-36b4f080-feba-11e8-8f72-3ee1aab4de68.png)
   
   
   So, I cut the webview's height, `[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])];`, but it leaves 20px grey area at the bottom, the webview's height is 20px shorter than it should be.
   ![2](https://user-images.githubusercontent.com/5656924/49909506-3c123b00-feba-11e8-9593-fe0b194171e0.png)
   
   
   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`? It looks pretty good!
   ![3](https://user-images.githubusercontent.com/5656924/49909527-4c2a1a80-feba-11e8-9f2e-6a47592a437e.png)
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org