Hello,
I have a UITableView with standard UITableViewCells that contain an image on the left. I'm setting the image of the cell as follows:
UIImage *leftIcon = [UIImage imageNamed:@"myImage.png"];
cell.imageView.image = leftIcon;
This works fine. However, there's a difference in appearance depending on which iPhone OS the App runs. Until 2.2.1 the image is positioned about 11 pixels from the left border. In 3.0, the image is positioned directly on the left border without any space.
My goal is that the image is positioned about 11px from the left of the cell on 3.0. I tried the following without any success:
UIImage *leftIcon = [UIImage imageNamed:@"myImage.png"];
//trying to change x coordinate of the frame of the UIImageView
CGRect tmpRect = cell.imageView.frame;
tmpRect.origin.x = 10;
cell.imageView.frame = tmpRect;
cell.imageView.image = leftIcon;
I could think of two possible solutions:
1.) Implement my custom UITableViewCell with a custom UIImageView on the left.
2.) Add an 11px transparent border to myImage.png with Photoshop :)
Any recommendations?