titanium-sdk
titanium-sdk copied to clipboard
feat(android): optionBar color properties
If you want to change the colors in an OptionBar you'll have to use a theme. This PR adds new properties selectectedBackgroundColor
, selectedBorderColor
, selectedTextColor
and maps the color
to the inactive text colors.
const win = Ti.UI.createWindow();
const optionBarDefault = Ti.UI.createOptionBar({
top: 0,
labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
const optionBar1 = Ti.UI.createOptionBar({
top: 50,
selectedBackgroundColor: "red",
selectedBorderColor: "#fff",
selectedTextColor: "blue",
color: "yellow",
labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
const optionBar2 = Ti.UI.createOptionBar({
top: 100,
color: "yellow",
labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
const optionBar3 = Ti.UI.createOptionBar({
top: 150,
selectedTextColor: "blue",
labels: [ 'Option 1', 'Option 2', 'Option 3' ]
});
win.add([optionBarDefault,optionBar1,optionBar2,optionBar3]);
win.open();