Ionic ion-view header behind ios status bar

后端 未结 10 2289
礼貌的吻别
礼貌的吻别 2021-01-04 09:15

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

I created the header with following code:



        
10条回答
  •  半阙折子戏
    2021-01-04 09:56

    Just a quick reminder, If this issue only happens in some of the subpages, you probably used nav.push() inside a modal(this is depreciated). To fix this issue, in your modal

    import { App, ViewController } from 'ionic-angular';
    
     constructor(
          public viewCtrl: ViewController
          public app: App
        ) {}
    

    replace push() with below

      //this.navCtrl.push(nextPage);
      this.viewCtrl.dismiss();
      this.appCtrl.getRootNav().push(nextPage);
    

提交回复
热议问题