views:

1508

answers:

1

I have an image that is 480x331 and has a transparent background. The transparent part is just around the image's edges. My UIButton is 72x37. When I set the image as a background image in IB for the button, the transparent edges of the image show as white in the button. Without an image, the button is white with rounded corners. I'm guessing that is the white I see coming through. If so, it means the image transparency is working but the button's white area is showing through.

If I set the image to the UIButton's Image property, it doesn't scale correctly, even after changing view mode, and remains at its full size.

Any suggestions on which property I should use to get the scaling and transparency to work right?

+2  A: 

What button type are you using?

By the sounds of it you are possibly using the UIButtonTypeRoundedRect style, but UIButtonTypeCustom may be more suitable. You can change this within Interface Builder's inspector window.

Christopher Fairbairn