Menu is not working when i push the screen ionic 3

2019-03-01 16:35发布

I have one screen login with home comes with menu, 4 tabs . Like home, about, location, more.And in this case menu working fine. When i login, i use this below code to navigate the screen to home pagewith all tabs , menu. That time its working fine.

 this.navCtrl.push(TabsPage);

And when i am in about screen . I have one button to show some data and when user press ok button it will show one screen with some score data:

this is that screen code:

<ion-header>
  <ion-navbar color="navcolr" no-border-bottom>
    <ion-title >Exam Score</ion-title>
  </ion-navbar>
</ion-header>
<ion-content padding fullscreen>

      <ion-card style="width: 91%;">

      <div style="font-size: 20px;text-align: center;">
        <span>Your Score : {{this.correctans}}</span>
      </div>

      </ion-card>

      <button ion-button style="width: 152px !important;margin-left: 23%;" (click)="cancelBtn()">CANCEL</button>

</ion-content>

This above screen will be a modalCtrl . So above you can see cancelbuton know. Once i press that it will go to taps pages.

Here that code :

cancelBtn() {
   //this.navCtrl.setRoot(TabsPage);
   this.navCtrl.push(TabsPage);
}

So its going to my home page with all menu icon, tap icon... But tabs are working.

updated:

I tried with dismiss viewcontrollerBut its dismiss only the view , so that still in my question page.....but i need to go to my tabspage...How can i do this ?

1条回答
聊天终结者
2楼-- · 2019-03-01 17:13

in modal page

import {ViewController} from 'ionic-angular';

...

 constructor(
    private view: ViewController
 ) {}

...

closeModal() { //handler to close modal.
    this.view.dismiss();
}
查看更多
登录 后发表回答