Menu is not working when i push the screen ionic 3

孤街醉人 提交于 2019-12-20 03:57:15

问题


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:


in modal page

import {ViewController} from 'ionic-angular';

...

 constructor(
    private view: ViewController
 ) {}

...

closeModal() { //handler to close modal.
    this.view.dismiss();
}


来源:https://stackoverflow.com/questions/44244660/menu-is-not-working-when-i-push-the-screen-ionic-3

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!