开发者

Opacity of a custom UIButton

By d开发者_运维技巧efault, we get the opacity of UIButton set to NO. Can we set it to YES?


Um... opacity is not a boolean value. It is a float in the range from 0.0 (fully transparent) to 1.0 (fully opaque). The property is actually called the alpha, so you'd do:

[myButton setAlpha:0.42];


setAlpha doesn't work in In swift:

photoButton.alpha = 0.3
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜