开发者

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 th开发者_开发技巧e button's background image.

Is it possible to make the image transparent?


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.


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).


You want to set the button opaque property to NO.

In InterfaceBuilder, you have a checkbox to do that.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜