Possible to change color of iPhone 'PLAIN' button style?

You must Login before you can answer or comment on any questions.

BAR style buttons can be given a color or inherit from their ButtonBar.No matter what I do (setting barColor of buttonBar, backgroundColor of button, barColor of window, and more), buttons in a buttonBar with style: Ti.UI.iPhone.SystemButtonStyle.PLAIN always appear as light gray. I want their shape, font, and click behavior but I need to be able to give them a different color. Is this possible?

1 Answer

Hi Jeremy,

you can not set the backgroundColor of the buttonBar but you can set style as you mentioned in your question..

but you can set the backgroundImage with the color of you want to set...

thnx

— answered 1 year ago by Mitul Bhalia
answer permalink
4 Comments
  • Thank you for your response, Mitul. Unfortunately this does not work for me. I have set a background image to the toolbar, the buttonBar, and then I changed from a buttonBar to a regular button. The first does nothing, the second set a background behind the PLAIN style button, and the third overrides the PLAIN button style.

    Unless you meant I need to use a background image that replicates the same look and feel of the PLAIN button style? This is what I hoped to avoid -- I just want to give it a color :)

    — commented 1 year ago by Jeremy Raines

  • i hope you set buttonBar like this...

    var buttonObjects = [{
        image : '../images/slider_thumb.png',
        width : 50
    }, {
        image : '../images/slider_thumb.png',
        width : 50
    }, {
        image : '../images/slider_thumb.png'
    }];
    var bb = Titanium.UI.createButtonBar({
        labels : buttonObjects,
        backgroundColor : '#000',
        top : 100,
        style : Titanium.UI.iPhone.SystemButtonStyle.BAR,
        height : 40,
        width : 'auto'
    });
     
    win.add(bb);

    — commented 1 year ago by Mitul Bhalia

  • No, I'm asking about setting the color or the button when it has style: Ti.UI.iPhone.SystemButtonStyle.PLAIN

    — commented 1 year ago by Jeremy Raines

  • Show 1 more comment

Your Answer

Think you can help? Login to answer this question!