bottom navigation bar nativescript

227 Views Asked by At

In the bottom navigation bar I want to change the button ActiveColor when I get true from service but the problem is I can't override button color with CSS it doesn't apply(nativescript angular)

<MDBottomNavigation....>
<MDTabStrip>
 <MDTabStripItem>
  ....
  <Image src="font..." [ngClass]="actionsActive?'first-color':'second-color'">
 ......
1

There are 1 best solutions below

3
Hristiyan Yanev On

Have tried dynamically adding a new class with javascript. Something like this:

element = document.getElementById("myDIV");
element.classList.add("mystyle");

and

your css file you can add:

.mystyle:active {
  background-color: some
}

Also you can use a variable like this:

[style.backgroundColor]="myBgColor"

and than dynamically set value to myBgColor

check this