Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Issues with background color on a button

Since Titanium 1.2.1 I cannot build a button without having a background image. If I build a button using a background color only, the background color doesn't display correctly, it only displays the backgroundcolor only between the corner and a white square center.

Here's my code :

var btmap = Titanium.UI.createButton({
    backgroundColor:'#eda034',
    title:'Plan',
    color:'#a6a6a6',
    selectedColor:'#990004',
    font:{fontSize:12,fontWeight:'bold',fontFamily:'Helvetica Neue'},
    height:40,
    width:40,
    left:270,
    top:15,
    borderRadius:5,
    borderWidth:1,
    borderColor:'#a6a6a6'
});
— asked April 17th 2010 by michel perrin
  • background
  • button
  • iphone
1 Comment
  • I am having this same issue. I can't do a background color or gradient at all. It only applies to the corners outside the rounded button. Anyone have any ideas? Help!

    — commented June 29th 2010 by Randy Hall

5 Answers

  • If you do:

    backgroundImage: 'none'

    Seems to work.

    — answered August 12th 2010 by Paul Pounder
    permalink
    1 Comment
    • Yep, it seems to work but it's definitely not a normal behavior.

      — commented December 3rd 2010 by Adrien Mas
  • Yeah, what's up with this? Why is there a backgroundGradient property on the Button object if you can't use it?

    Maybe you have to turn off the default system styling somehow. Who knows. No seriously, who knows!? :)

    — answered June 29th 2010 by Clifton Labrum
    permalink
    0 Comments
  • Background colours on system buttons is not possible in Appcelerator and as far as I can see the iPhone SDK.

    More information can be found here: http://bit.ly/d4HsnQ

    — answered October 14th 2010 by Steve Clarke
    permalink
    0 Comments
  • Has there been any news on this ticket Kevin? Seems to have been open for a couple of months.

    I can't add any styles to my buttons.

    Kind regards

    Paul

    — answered August 12th 2010 by Paul Pounder
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.