After logging in, my single screen contains a home menu with four tabs: home, about, location, more
. The menu functions properly in this setup. To navigate to the home page with all tabs and the menu after login, I use the following code:
this.navCtrl.push(TabsPage);
While on the about
screen, there is a button that displays some data. When the user presses the OK button, a new screen showing score data appears:
This is the code for that screen:
<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 serves as a modalCtrl. When the "Cancel" button is pressed, it should go back to the tabs pages.
Here is the corresponding code:
cancelBtn() {
//this.navCtrl.setRoot(TabsPage);
this.navCtrl.push(TabsPage);
}
After pressing the Cancel button, it returns to the home page with all menu icons, tap icons, but the tabs are not functioning.
Updated:
I attempted to use dismiss viewcontroller
, but it only dismisses the view, leaving me still on the question page. I need to navigate to my tabspage
. How can I accomplish this?