【问题标题】:How to remove the space at the top of Ionic Webview on iOS?如何在 iOS 上删除 Ionic Webview 顶部的空间?
【发布时间】:2014-10-13 20:43:13
【问题描述】:

这是我第一次使用 Ionic 进行开发。

我已尝试删除应用程序中的状态栏。现在,iPad 应用程序的状态栏已被移除。但是,我的 Iconic 视图顶部仍然有一个空间(我认为它的大小与状态栏相同)。我已经使用此代码设置了 Javascript 文件来隐藏状态栏,但它不起作用。

ionic.Platform.ready(function() {
// hide the status bar using the StatusBar plugin
StatusBar.hide();
// ionic.platform.fullScreen();
});

我该如何解决这个问题或者我做错了什么? 谢谢。

这是在网络浏览器和 iOS 模拟器上比较的图像

【问题讨论】:

    标签: javascript ios css cordova ionic-framework


    【解决方案1】:

    我遇到了同样的问题。我用过:

    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();是我项目中的东西。这会删除顶部的空间。

    【讨论】:

      【解决方案2】:

      你有没有像这样安装状态栏插件:

      $ cordova plugin add org.apache.cordova.statusbar
      

      只有在那之后,你才能移除状态栏:

      angular.module('myApp', ['ionic'])
      
      .controller('MyCtrl', function($scope) {
        ionic.Platform.ready(function() {
          // hide the status bar using the StatusBar plugin
          StatusBar.hide();
        });
      });
      

      【讨论】:

        【解决方案3】:

        也许他的解决方法可能会有所帮助...this.statusBar.overlaysWebView(true);

        【讨论】:

          猜你喜欢
          • 2017-10-25
          • 2011-09-29
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-08-11
          相关资源
          最近更新 更多