在iPhone中预览圆形图像

cam*_*ilo 4 iphone xcode objective-c interface-builder uiimageview

任何人都可以告诉我如何在自定义单元格内创建图像预览,其中包含mms中加载的图像的方面.

我一直试图通过改变IB中的值来做到这一点,但我无法做到.

非常感谢!

alt text http://iphonehelp.in/content/uploads/2009/03/30-mms.jpg


谢谢你的三个答案.

cell3.imageView.layer.masksToBounds = YES;
cell3.imageView.layer.cornerRadius = 16;
cell3.imageView.layer.borderColor = [UIColor lightGrayColor].CGColor;
cell3.imageView.layer.borderWidth = 1.0; 
Run Code Online (Sandbox Code Playgroud)

我能够做我想要的一部分.但是,我仍然无法在图像上看到"发光"的样子.现在有人应该控制哪个属性?

非常感谢(再次感谢).

Noa*_*oon 17

当然.将QuartzCore框架添加到项目中,然后:

#import <QuartzCore/QuartzCore.h>
// ...
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.cornerRadius = 4;
Run Code Online (Sandbox Code Playgroud)

请注意,该cornerRadius属性仅在OS 3.0及更高版本中可用; 如果你支持旧版本(你可能不必这样做),你需要做一些核心图形工作.