这是我第一次使用 Ionic 进行开发。
我试图删除应用程序中的状态栏。现在,删除了 iPad 应用程序的状态栏。但是,我的 Iconic View 顶部仍然有一个空间(我认为它的大小与状态栏相同)。我已经使用此代码设置了 Javascript 文件以隐藏状态栏,但它不起作用。
ionic.Platform.ready(function() {
// hide the status bar using the StatusBar plugin
StatusBar.hide();
// ionic.platform.fullScreen();
});
我该如何解决这个问题或者我做错了什么? 谢谢。
这是在网络浏览器和 iOS 模拟器上的对比图
最佳答案
我遇到了同样的问题。我用过:
ionic.Platform.ready(function() {
//hide the status bar using the StatusBar plugin
if(window.StatusBar) {
// org.apache.cordova.statusbar required
StatusBar.hide();
ionic.Platform.fullScreen();
}
});
ionic.Platform.fullScreen();是我元素中的东西。这将删除顶部的空间。
关于javascript - 如何在 iOS 上删除 Ionic Webview 顶部的空间?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25405605/