OGeek|极客世界-中国程序员成长平台

标题: ios - 如何在 iOS 上制作 Meteor Cordova *NOT* 全屏? [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 15:31
标题: ios - 如何在 iOS 上制作 Meteor Cordova *NOT* 全屏?

我使用 Cordova for iOS 运行/构建我的 Meteor Web 应用程序。不幸的是,我得到一个覆盖顶部状态栏(包括运营商、时间、电池等)的全屏应用程序。我试图避免它 - 有一个常规(即非全屏)应用程序。

我已明确将全屏首选项设置为 false:

App.setPreference('Fullscreen', false);

但应用仍然会占用 100% 的屏幕高度。如果重要的话,我也在使用 ionic 。

有什么想法吗?



Best Answer-推荐答案


这由 status bar plugin 处理:

App.setPreference("StatusBarOverlaysWebView", false);

因此,如果您将此设置为 false,则 Web View 将不再覆盖状态栏,也不会是“全屏”。

您还有其他一些偏好来控制状态栏的颜色。来自状态栏插件文档:

StatusBarBackgroundColor (color hex string, no default value). On iOS 7, set the background color of the statusbar by a hex string (#RRGGBB) at startup. If this value is not set, the background color will be transparent.

<preference name="StatusBarBackgroundColor" value="#000000" />

StatusBarStyle (status bar style, defaults to lightcontent). On iOS 7, set the status bar style. Available options default, lightcontent, blacktranslucent, blackopaque.

<preference name="StatusBarStyle" value="lightcontent" />

针对 Cordova 的文档和 Meteor 之间的唯一区别是首选项是使用 mobile-config.js 文件中的 App.setPreference 而不是 <首选项名称=...。在 config.xml

如果您 build your own config.xml,则可以使用 Cordova 表示法但这不是必需的,因为 Meteor 表示法能够将这些传递给它在后台为您构建的 config.xml

关于ios - 如何在 iOS 上制作 Meteor Cordova *NOT* 全屏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30961284/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4