Obj-C, how can I add a background colour to image I'm adding to cell.imageview, its a PNG?
I am using PNG images to add icons to the rows in my tableview, using
[cell.imageView setImage:[UIImage imageNamed:@"chart.png"]];
This was not a problem before, as my images had black edges and my tableview had black rows. However, I am now providing a light color style as well as dark. So the black edges look rough.
So I thought I would draw the images with a black background.
However, I don't know how to do t开发者_高级运维his?
UIImageView
inherits from UIView
so you can just set the backgroundColor
property to show a color behind the transparant parts of your png
image
[cell.imageView setBackgroundColor:[UIColor blackColor]];
精彩评论