开发者

Transparent Buttons in iPhone SDK

开发者 https://www.devze.com 2022-12-19 13:28 出处:网络
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 (wh

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
});
0

精彩评论

暂无评论...
验证码 换一张
取 消