我有一個包含左側圖像的標準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?