angular – 在Ionic中隐藏StatusBar 2

前端之家收集整理的这篇文章主要介绍了angular – 在Ionic中隐藏StatusBar 2前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我使用Ionic 2构建了一个应用程序.当我在浏览器中运行它时,UI看起来不错,但是一旦我在iOS模拟器中运行,一切看起来都很笨重.问题在于状态栏.我需要隐藏状态栏.我尝试使用离子原生的StatusBar,像这样 –

import {StatusBar} from 'ionic-native';
constructor(platform: Platform) {
    platform.ready().then(() => {
      // Okay,so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      StatusBar.hide();
      //StatusBar.styleDefault();
    });

但实际上它没有隐藏状态栏,而是它只是覆盖状态栏颜色与我的页面标题颜色.隐藏状态栏的任何解决方案.

解决方法

我正在研究ionic3,并希望它也适用于离子2.
我也需要相同的,这是我的本地设置 –

li packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.12.0
    ionic (Ionic CLI) : 3.12.0

global packages:

    cordova (Cordova CLI) : 7.0.1 

local packages:

    @ionic/app-scripts : 2.1.4
    Cordova Platforms  : android 6.2.3 ios 4.4.0
    Ionic Framework    : ionic-angular 3.6.0

现在对以下文件进行更改 –

config.xml中

<preference name="Fullscreen" value="true" />

Component.ts

StatusBar.overlaysWebView(true);

这对我有用.

Note:- Changes will reflect in simulator or android phone only,not in browser.

猜你在找的Angularjs相关文章