Transparent Buttons in iPhone SDK
-
19-09-2019 - |
Question
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 button to be transparent without touching the alpha (when alpha = 0.0 on a UIButton, it no longer responds to touch)?
Thanks. :)
Solution
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.
OTHER TIPS
Set your button type to UIButtonTypeCustom and it will have no styling. (thus, it should be "invisible").
Try this
var btnTest = Ti.UI.createButton({
backgroundImage: 'sample.png',
height: 24,
width: 20,
top: 10,
left:10
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow