我有一个包含左侧图像的标准UITableViewCells的UITableView。我设置单元格的图像如下:在OS 3.0中更改UITableViewCell中左侧UIImageView的位置
UIImage *leftIcon = [UIImage imageNamed:@"myImage.png"];
cell.imageView.image = leftIcon;
这工作正常。但是,外观有所不同,具体取决于App运行的iPhone OS。在2.2.1之前,图像距离左边界约11个像素。在3.0中,图像直接位于左边界上,没有任何空间。
我的目标是在3.0的单元格左侧放置图像大约11px。我想没有任何成功以下几点:
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;
我能想到的两种可能的解决方案:
1)执行我的自定义的UITableViewCell在左侧的自定义的UIImageView。
2)添加11像素透明边框使用Photoshop :)
任何建议myImage.png?