开发者

Opacity of a custom UIButton

开发者 https://www.devze.com 2023-02-28 14:29 出处:网络
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 opa

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

精彩评论

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