简体   繁体   中英

Nav bar disappear when I open specific page for second time

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.

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> 

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM