Tabs disappears ionic 3 after push

你。 提交于 2019-12-05 22:41:08

If you need to navigate from an overlay component (popover, modal, alert, etc) then you must do it like below.

test.ts

export class TestPage {
    constructor(
      public viewCtrl: ViewController
      public appCtrl: App
    ) {}

    openMenu() {
      this.viewCtrl.dismiss();
      this.appCtrl.getRootNav().setRoot(HomePage);
    }
  }

You can read more about it here(see under the title Navigating from an Overlay Component).

I just found a workaround.

Tab disappear if push() is called from a page that's not in the tab. So, I call an event

this.events.publish('gotochat', { item: element });

Then, I navigate to my root Tab

this.nav.setRoot('TabsPage', { index: 1 }, {
        animate: true,
        direction: 'forward'
      });

In the land page, I listen to the event and push the desired page.

this.events.subscribe('gotochat', (item) => {
  this.navCtrl.push('ItemDetailPage', {
    home: true,
    chat: item.item
  })
})
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!