Oliver
Oliver

Reputation: 403

cocoa/iPad How do I keep a UIButton clickable when its alpha == 0?

When I set a UIButton's alpha to 0, it behaves as if it isn't enabled. I've checked and, even though the button does remain enabled (though invisible (but not hidden, I checked that as well)), it ceases to work.

Is there any way to keep it clickable even when its alpha is 0?

Upvotes: 5

Views: 2275

Answers (2)

kiichiro
kiichiro

Reputation: 111

UIButtonStyle set to "custom". And instead of alpha 0, you need to set background to 'clear color'.

Upvotes: 11

Björn Kaiser
Björn Kaiser

Reputation: 9912

Try to put another UIButton on top of it with it's UIButtonStyle set to "custom" and just leave it as it is, except of adding your IBAction to it.

Upvotes: 10

Related Questions