I am trying to find a possible way to hide the ionic ion-nav-bar
without hiding the ion-nav-bar
buttons.
I have tried
hide-nav-bar="true"
but it is hiding buttons too. I have searched and also referred this, but nothing solved my problem.
regards.
You just have to specify what state want to hide the bar, and modify some styles
JS:
$rootScope.$on('$stateChangeStart', function(ev, toState, toParams, fromState, fromParams){
var states = ['tabs.about', 'tabs.contact'];
if(states.indexOf(toState.name) > -1) {
$rootScope.hideBar=true;
} else {
$rootScope.hideBar=false;
}
});
HTML:
<ion-nav-bar class="bar-positive" ng-class="{ 'make-border-trasparent': hideBar }">
<ion-nav-back-button>
</ion-nav-back-button>
</ion-nav-bar>
Please take a look at this example (I'm hiding the bar in the tabs.about
and tabs.contact
states)
Codepen