I'm trying to create a transparent button in my iPhone app -- to create an Easter Egg of sorts. How would I go about setting the but开发者_JAVA百科ton to be transparent without touching the alpha (when alpha = 0.0 on a UIButton, it no longer responds to touch)?
Thanks. :)
Set your button type to UIButtonTypeCustom and it will have no styling. (thus, it should be "invisible").
You could set the alpha to a very small value.
Or, you could create a blank, clear UIImage and use a custom button style, and set it to the button's image.
Try this
var btnTest = Ti.UI.createButton({
backgroundImage: 'sample.png',
height: 24,
width: 20,
top: 10,
left:10
});
精彩评论