Abhinav
Abhinav

Reputation: 38172

Opacity of a custom UIButton

By default, we get the opacity of UIButton set to NO. Can we set it to YES?

Upvotes: 7

Views: 16320

Answers (2)

Esqarrouth
Esqarrouth

Reputation: 39201

setAlpha doesn't work in In swift:

photoButton.alpha = 0.3

Upvotes: 10

Dave DeLong
Dave DeLong

Reputation: 243166

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];

Upvotes: 27

Related Questions