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];
精彩评论