Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
ActionBar TabView colors - NS 1.4
<?xml version="1.0" encoding="utf-8"?>
<resources xmlns:android="">
<style name="AppThemeBase" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Set the text color used for ActionItems to white-->
<item name="actionMenuTextColor">#FFFFFF</item>
<!-- ... -->
<!-- ... -->
var color = require("color");
var platform = require("platform");
function pageLoaded(args) {
var page = args.object;
if (platform.device.os === {
// ------ ActionBar --------
// Set ActionBar background color - done in XML/CSS
// Set ActionBar title color
var actionBarTextColor = new color.Color("white");
// ------ TabView --------
var tabView = page.getViewById("tabView");
var tabContainer = tabView._tabLayout;
// Set TabView background
var bgColor = new color.Color("blue");
// Set TabView selected-indicator color
var selectedIndicatorColor = new color.Color("yellow");
// Set title color of TabView items - currently no easy way to do it.
exports.pageLoaded = pageLoaded;
<Page xmlns="" loaded="pageLoaded">
<ActionBar title="My Title" style="background-color:blue; color:white">
<TabView id="tabView">
<TabViewItem title="First">
<Label text="First Tab" />
<TabViewItem title="Second">
<Label text="Second Tab" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment