How can I change border color of tab in tab navigator control at runtime? I am trying to access it with its id "mytab" and update it's style.
this.mytab.setStyle("bordercolor","red");
A TabNavigator has multiple tabs and I have to change style of few tabs based on some logic. StyleDeclaration is applicable for all the tabs under tab navigoter but how can use CSSStyleDeclaration based on componentid? The only shortfall with this approach is that Style can not be changed for individual tab.
Setting the style directly on the
TabNavigator
won't work. You have to set thetabStyleName
property onTabNavigator
and then create a style with the same name, which will be applied to your tabs. It is the same strategy as my answer to your other question; just set theborderColor
style instead.If you really need to set the style dynamically at runtime, you can retrieve the
CSSStyleDeclaration
for the tabs and set it like so: