顶部的Cordova iOS白色栏 [英] Cordova iOS white bar at top
问题描述
在将statusbaroverlayswebview添加到config.xml后,我在屏幕顶部得到一个白条,并且所有内容都被向下推(请参见屏幕截图-在状态栏的顶部有一个白条).因此,它不仅增加了状态栏高度(20px)到屏幕,还增加了40px.
After adding StatusBarOverlaysWebview to config.xml, i get a white bar at the top of the screen and all the content is pushed down (see screenshot - there is a white bar on top of the statusbar). So instead of just adding the statusbar height (20px) to the screen, it adds 40px.
我仔细检查了所有样式,一切看起来都很好,所以我猜想它是由插件造成的.谁能告诉我如何解决这个问题?
I double-checked all my styling and everything looks fine, so i guess its caused by the plugin somehow. Can anyone tell me how to solve this?
这是我的配置:
<preference name="StatusBarOverlaysWebview" value="false" />
<preference name="StatusBarBackgroundColor" value="#FF543E" />
<preference name="fullscreen" value="true" />
这是没有设置颜色并使用window.StatusBar.overlaysWebView(false);的外观.而不是config.xml
This is what it looks like without setting a color and using window.StatusBar.overlaysWebView(false); instead of config.xml
推荐答案
尝试一下,下面的代码对我有用:
Try this, below code is working for me:
<preference name="StatusBarOverlaysWebView" value="false" />
<preference name="StatusBarBackgroundColor" value="#2D81C1" />
<preference name="Fullscreen" value="false" />
如果您仍然有问题,并且在以前的版本中相同的代码对您有用,请检查插件是否已安装并正常工作
if you still have problem and if the same code was working for you in the previous builds, please check if plug in is installed and working properly
更新:对于iOS 11和iPhone X,库和HTML元标记中有一些更改
Update: For iOS 11 and iPhone X there are some changes in the library and HTML meta tags
在index.html中,将元标记更改为此:
In index.html change meta tag to this:
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
请同时更新离子角库以获得最新设备支持
Please update ionic-angular library also for the latest devices support
此处提供更多信息: iOS 11离子清单
这篇关于顶部的Cordova iOS白色栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!