views:

223

answers:

2

I have a UITableViewCell, and I want to use the image property to fill it with an image. When it is first in a grouped UITableView, I want it to have the standard rounded corners.

Unfortnately, the image fills the rounded corners as well.. Is there any way to retain them without using a transparent image?

A: 

I just made my non-transparent images have the rounded corner. Take a screen shot to get the dimensions of the rounded corner then use that as the basis for your image.

Epsilon Prime
A: 


You can round the corners of any view programmatically by using its layer property. If you play about with the cornerRadius property of the layer you should be able to achieve the results you want.

#include <QuartzCore/QuartzCore.h>

UIImage *myImage = [UIImage imageNamed:@"image.png"];
myImage.layer.cornerRadius = 10.0;
imnk
i want rounded corners only in the top right and left corners, for the first cell, so this doesn't help much.. Thanks anyway
johnl