views:

130

answers:

1

Does someone know how to colorize a UIButton (iphone)? I have a greyscale image with alpha that I want to colorize to various different colors. Setting things like background color only shade the entire image without respecting the alpha.

Is there a straightforward way to do this, or will I need to subclass UIButton and overload the drawRect method perhaps? Thanks.

A: 

One option is to use a one-segment UISegmentedControl, which provides access to a tint property. These can behave like a UIButton with the right settings, and look a lot like the glass-style that Apple uses for its iPhone apps.

Alex Reynolds