ios 状态栏后面的 Ionic 离子视图标题 [英] Ionic ion-view header behind ios status bar

查看:20
本文介绍了ios 状态栏后面的 Ionic 离子视图标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何避免 ionic header 像这样落后于 ios 状态栏?

How do I avoid ionic header from getting behind ios status bar like this?

我使用以下代码创建了标题:

I created the header with following code:

<ion-view title="{{title}}" hide-nav-bar="false">

推荐答案

终于解决了问题.

在 app.js 中

$ionicPlatform.ready(function() {
  if (window.cordova && $cordovaKeyboard) {
    $cordovaKeyboard.hideAccessoryBar(true);
  }
  if (window.StatusBar) {
    StatusBar.styleDefault();
  }
}

而且,如果这还不能解决问题.在 index.html 中,cordova.js 应该在最后导入.

and, if that doesn't solve the problem yet. In index.html, cordova.js should be imported on the very last.

<head>
    ...

    <script src="cordova.js"></script>
</head>

这解决了我的问题.

这篇关于ios 状态栏后面的 Ionic 离子视图标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆