I need to change the color of the ionic tab from controller , i have changed the tittle bar color from controller like this.. in html page i wrote ..
<ion-nav-bar class="bar-positive" ng-style="{'background-color': viewColor}">
<ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
and in controller i called ..
$scope.$on('$ionicView.beforeEnter', function() {
$rootScope.viewColor = 'green';
});
and in css i wrote ..
.nav-bar-block, .bar {
background-color: inherit !important;
}
In the same way can i change the color of the tab ... Is there any way to achieve it ?? Any help would be appreciated...
Thanks.
test this code,can use style
Instead ng-style
<ion-nav-bar class="bar-positive" style="background-color:{{viewColor}}">
<ion-nav-back-button></ion-nav-back-button>
</ion-nav-bar>
&
$scope.$on('$ionicView.beforeEnter', function() {
$rootScope.viewColor = 'green';
});
or You can use an existing style in this url http://ionicframework.com/docs/components
for example green style for header
<div class="bar bar-header {{bar_style}}">
<h1 class="title">bar-balanced</h1>
</div>
&
$scope.$on('$ionicView.beforeEnter', function() {
$rootScope.bar_style = 'bar-balanced';
});