推送新页面时如何保持标签? [英] How to keep tab when pushing a new page?

查看:10
本文介绍了推送新页面时如何保持标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

When I push a new tab like this in my controller:

this.nav.push(EditPage);

the tab disappears. How can I keep the tab?

Pic below:

When the new page comes:

解决方案

You'd need to add the tabSubPages:false config in your ionicBootstrap like this:

ionicBootstrap(MyApp, [], {      
    tabSubPages:false
});

By doing that, and because that each tab has its own history stack, and NavController instances injected into children @Components of each tab will be unique to each tab, the new page will be opened inside the current tab.


UPDATE:

Please notice that with the new release of Ionic 2.0.0-beta.11 (2016-08-05) that config was renamed to tabsHideOnSubPages so it should be:

ionicBootstrap(MyApp, [], {      
    tabsHideOnSubPages:false
});

The previous names have been deprecated. They will still work in the current release but will be removed in the future so please update to the new names.

这篇关于推送新页面时如何保持标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆