Button backgroundGradient bug?
It seems that there is a bug in getting a backgroundGradient to work on a Button for iPhone. If one of the gradient colors is #000000 it is disregarded and winds up being displaying as white. However if you do #000001, it displays properly.
I also found that unless you set the style to "style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN" and the gradient property "backFillStart: false" – it also doesn't work. Those may not be bugs but it would be great if they could be documented with sample code in the API.
Here is an example of a button that works:
closeButton = Titanium.UI.createButton({<br />
title:'Close',<br />
width:150,<br />
height:40,<br />
style:Titanium.UI.iPhone.SystemButtonStyle.PLAIN,<br />
borderRadius:10,<br />
font:{fontSize:16,fontFamily:_fontFamily,fontWeight:'bold'},<br />
backgroundGradient:{type:'linear',colors:['#000001','#666666'],startPoint:{x:0,y:0},endPoint:{x:2,y:50},backFillStart:false},<br />
borderWidth:1,<br />
borderColor:'#666'<br />
});
1 Answer
-
Yes I would definitely classify this as a bug. You can use the following values to represent black and none of them will work as a background gradient color.
black #000 #f000 #000000 #ff000000