Francesco
Francesco

Reputation: 21

transparent button

Is there a way to make a button transparent without alpha?

To explain: I have a background image on my view. There is also a button with an image background. If the image has a transparent part I see white inside the button's background image.

Is it possible to make the image transparent?

Upvotes: 2

Views: 2016

Answers (3)

Chris Nolet
Chris Nolet

Reputation: 9063

You can set the button type to 'Custom', either in code with: UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; or in IB on the Attributes pane, under Button -> Type -> Custom.

Upvotes: 3

Pascal
Pascal

Reputation: 16941

Set the backgroundColor of the button to [UIColor clearColor] and optionally its opaque to NO (Should automatically be applied by setting the background color to transparent).

Upvotes: 1

jv42
jv42

Reputation: 8583

You want to set the button opaque property to NO.

In InterfaceBuilder, you have a checkbox to do that.

Upvotes: 0

Related Questions