开发者

colorizing UIbuttons

开发者 https://www.devze.com 2022-12-29 03:09 出处:网络
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 sh开发者_运维问答

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 sh开发者_运维问答ade 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.


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.

0

精彩评论

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