2010-03-15 69 views
5

任何人都可以告诉我如何在自定义单元格内创建图像预览,并在mms中加载该单元格。在iphone中预览圆形图像

我一直在尝试通过更改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; 

我能够做我想做的一部分。但是,我仍然无法将这种“焕发”的形象放在形象上。现在有人应该控制哪些财产吗?

非常感谢(并再次感谢)。

回答

17

当然。在QuartzCore框架添加到项目中,则:

#import <QuartzCore/QuartzCore.h> 
// ... 
cell.imageView.layer.masksToBounds = YES; 
cell.imageView.layer.cornerRadius = 4; 

注意,cornerRadius属性仅在OS 3.0及更高版本;如果您支持较旧的版本(您可能不需要),则需要执行一些Core Graphics工作。

0

如果你的形象是一个图像视图和你的目标OS 3.0+,你可以设置imageView.layer.cornerRadius这可能是有用的。