2011-06-13 31 views
0

我想显示图像在表视图单元格中的设置。所有的图像都是不同的大小。我想剪裁或调整图像大小,使其看起来像照片应用程序。我怎样才能做到这一点。
谢谢,
Shakthi
cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; cell.imageView.image = image; UIImageView * view=cell.imageView;我如何curreclty裁剪/调整大小的图像在tableviewcells适合适当

view.frame = CGRectMake(0, 0, 70 , 70);//not working 
view.bounds = CGRectMake(0, 0, 70 , 70);//not working 

我的结果;

enter image description here

期待 enter image description here 照片应用程序的所有图像很好地改变大小均匀。

+0

你如何在tableView中添加它? ,发布相关的代码。 – Jhaliya 2011-06-13 15:34:58

回答

1

使用下方裁切图像时,需要传递裁切矩形。

CGImageRef myImageRef = CGImageCreateWithImageInRect([largeImage CGImage], myCropRect); 
myImage = [UIImage imageWithCGImage:myImageRef ]]; 
CGImageRelease(myImageRef); 
相关问题