开发者

how to change the color of a rounded button image programmatically in an iPhone/IOS application?

I am used a rounded image to create (in iPhone) a rounded button effect for cells in a UITableViewController.

Question - Is there a way I could programmatically change the background area of the rounded cell, which is basically the rounded UIImage I'm using? 开发者_JS百科 That is, without having the color spil outside the rounded edge area?

(i.e. currently the color is hard coded into the image effectively, would like to offer the ability for the user to be able to choose the color they want)


You can refer to OpenCV for the image processing and you can change the colors.

OpenCV.

I hope this helps you.


Try this code its definitely help you.

CALayer *layer = [<yourimageview> layer];
[layer setMasksToBounds:YES];
[layer setCornerRadius:5.0];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜