如何在Ionic 2中隐藏带有标签的导航栏? [英] How to hide nav-bar with tabs in Ionic 2?

查看:115
本文介绍了如何在Ionic 2中隐藏带有标签的导航栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用Ionic 2中的标签隐藏导航栏?

How to hide nav-bar with tabs in Ionic 2?

我只想将其隐藏在其中一个页面中,不包括其他页面。

I only want to hide it in one of the pages excluding others.

<ion-navbar *navbar   >
  <ion-title>Item Details</ion-title>
</ion-navbar>

我试过 hide-nav-bar =true但它不起作用。

推荐答案

从标签页中你可以做到:

From a tab page you can do:

this.nav.parent.parent.setRoot(LoginPage);

之前:

导航 - >标签 - >某页

之后:

导航 - >登录页面


导航是Ionic 2中所有导航堆栈的根目录

Nav is the root of all nav stacks in Ionic 2

此外,模式适用于您希望在没有导航选项卡或新导航选项卡的情况下显示列表项详细信息的情况导航栏占用宝贵的屏幕空间。

Also, a modal works well for a situation where you want to show a list item's detail in a new view without navigation tabs or a nav bar taking up valuable screen space.

目前我认为除了使用CSS之外,还有一种方法可以在标签页的子视图上隐藏标签。如果您决定使用CSS选项,那么我建议使用Angular的ngClass属性 https://angular.io/docs/ts/latest/api/common/index/NgClass-directive.html 设置一个类,而不是隐藏导航标签或导航栏。

Currently I don't think there is a way to hide tabs when on the child view of the tabs page other than using CSS. If you decide to go with the CSS option then I would suggest using Angular's ngClass attribute https://angular.io/docs/ts/latest/api/common/index/NgClass-directive.html to set a class than will hide the nav tabs or nav bar.

这篇关于如何在Ionic 2中隐藏带有标签的导航栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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