My APP works with tabs, inside these tabs I have buttons that open other pages using push
, when I click on tab 2, and click on a button, it opens the normal page, then I click on tab 1, and then click again in tab 2, but instead of showing the start page of tab 2, it already comes open with the page that I had clicked before ... How do I make it every time it clicks on a tab, it shows exactly the Page of that tab, and do not bring the page I had visited open? I tried using this.tabRef.select (0);
Inside the tab.ts but it double-clicks on the first click of each tab, which causes a blink on the screen leaving it blank for a few seconds by calling it twice ... I tried this.navCtrl.setRoot (HomePage ) ;
, but it takes the tabs off the screen, as it takes HomePage as the home page.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use this code in child pages of tab:
ionViewDidLeave(){
this.navController.setRoot(/*your tab page*/);
}