I just started using Nativescript. I have a button declared in the XML calling (id="mainButton" class="btn") an external css file. Everything works fine (button originally renders in blue). However, I need to change its color to red, via code.
How to do that?
I've tried the line below without success (no errors in the console but the page does not render anymore):
page.css = "mainButton { backgroundColor: red }";