I have an issue with my nav bar.
我的导航栏有问题。
Issue:
For example I have two pages. A homepage having sign in button and a sign in page. I have a back button on sign in page to go back to homepage. First time I press the back button, it works. But when I press sign in button again from the homepage, sign in page opens but without nav bar.
Here is the code of my sign in page, using desktop Ionic and running the project using Ionic serve in cmd.
例如,我有两页。有登录按钮和登录页面的主页。我在登录页面上有一个后退按钮返回主页。我第一次按后退按钮,它的工作原理。但是,当我再次从主页按下登录按钮时,登录页面会打开但没有导航栏。这是我登录页面的代码,使用桌面离子并使用cmd中的Ionic服务运行项目。
Ask any further info you need.
询问您需要的任何进一步信息。
Thanks in advance :)
提前致谢 :)
</head>
<body ng-app="app" animation="slide-left-right-ios7" class="grade-a platform-browser platform-win32 platform-ready">
<div>
<div>
<ion-nav-bar class="bar bar-header bar-balanced" style="background-color: #008000" nav-bar-transition="ios" nav-bar-direction="forward" nav-swipe="">
<ion-nav-back-button class="hide"></ion-nav-back-button>
<div class="nav-bar-block" nav-bar="active">
<ion-header-bar class="bar-stable bar bar-header" align-title="center">
<div class="title title-center header-item" style="transform: translate3d(0px, 0px, 0px); left: 96px; right: 96px;"><b>SIGN IN</b></div>
</ion-header-bar>
</div>
<div class="nav-bar-block" nav-bar="cached">
<ion-header-bar class="bar-stable bar bar-header" align-title="center">
<ion-nav-buttons side="left" class="has-header">
<button ng-click="$ionicGoBack()" class="button back-button buttons button-clear header-item">
<img src="img/back.png"> </img> </button>
<div class="title title-center header-item" style="transform: translate3d(16px, 0px, 0px); opacity: 0;"></div>
</ion-header-bar>
</div>
</ion-nav-bar>
</div>
</div>
</body>
</head>
1 个解决方案
#1
2
I had the same problem with my ionic app- the nav bar showed up fine until you revisited that view for a second time, then it would disappear. It seemed that a hide class being added to the element when it should not have been. I think this may actually be a bug with ionic, so I got around it by adding:
我的离子应用程序遇到了同样的问题 - 导航栏显示正常,直到您再次访问该视图,然后它就会消失。似乎一个隐藏类被添加到元素中,而不应该被添加到元素中。我认为这实际上可能是离子的一个错误,所以我通过添加:
display: block!important;
to my css for the nav bar. Not the most elegant solution, but it works.
我的css导航栏。不是最优雅的解决方案,但它的工作原理。
#1
2
I had the same problem with my ionic app- the nav bar showed up fine until you revisited that view for a second time, then it would disappear. It seemed that a hide class being added to the element when it should not have been. I think this may actually be a bug with ionic, so I got around it by adding:
我的离子应用程序遇到了同样的问题 - 导航栏显示正常,直到您再次访问该视图,然后它就会消失。似乎一个隐藏类被添加到元素中,而不应该被添加到元素中。我认为这实际上可能是离子的一个错误,所以我通过添加:
display: block!important;
to my css for the nav bar. Not the most elegant solution, but it works.
我的css导航栏。不是最优雅的解决方案,但它的工作原理。