Javascript 离子2-隐藏子页面上的选项卡
我的ionicbootstrap配置中有:Javascript 离子2-隐藏子页面上的选项卡,javascript,typescript,ionic-framework,ionic2,Javascript,Typescript,Ionic Framework,Ionic2,我的ionicbootstrap配置中有: { mode: 'md', tabsHideOnSubPages: true } 在“我的设置”上,但在某些子页面上显示选项卡。这似乎是一种随机行为。 这样做对吗 离子型:2.0。0@beta.11 谢谢 阿图尔 # 编辑: 我正在使用此修复程序使选项卡消失: ionViewWillEnter() { let tabs = document.querySelectorAll('.show-tabbar'); if (tab
{
mode: 'md',
tabsHideOnSubPages: true
}
在“我的设置”上,但在某些子页面上显示选项卡。这似乎是一种随机行为。
这样做对吗
离子型:2.0。0@beta.11
谢谢
阿图尔
#
编辑:
我正在使用此修复程序使选项卡消失:
ionViewWillEnter() {
let tabs = document.querySelectorAll('.show-tabbar');
if (tabs !== null) {
Object.keys(tabs).map((key) => {
tabs[key].style.transform = 'translateY(56px)';
});
} // end if
}
ionViewDidLeave() {
let tabs = document.querySelectorAll('.show-tabbar');
if (tabs !== null) {
Object.keys(tabs).map((key) => {
tabs[key].style.transform = 'translateY(0)';
});
} // end if
}
但这肯定是一种糟糕的方式。有什么简单的方法吗?2017回答 基于,您只需将
选项卡deonsubpages:true
添加到您的应用程序配置中,如下所示:
app.module.ts
imports: [
BrowserModule,
IonicModule.forRoot(AppComponent, {
tabsHideOnSubPages: true
})
]
你有没有下过决心?我想阻止我的标签隐藏在子页面上。谢谢。对问题进行了修改,但仍在寻找更好的解决方案。。。您使用的是哪个版本的Ionic@rashadb?我使用的是Ionic2.2.1。我有相反的问题。我不知道这是否有帮助,但您可以在这里看到解决方案: