在iPhone中预览圆形图像 [英] Preview rounded image in iphone
问题描述
任何人都可以告诉我如何在自定义单元格内创建图像预览,其中包含mms中加载的图像的方面。
can anyone tell me how can I create an image preview inside a customized cell with the aspect of the ones loaded in the mms'.
我一直在尝试通过改变IB中的值来做到这一点我无法做到。
I've been trying to do it by changing values in IB and I haven't been able to.
非常感谢!
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;
我能够做我想要的一部分。但是,我仍然无法在图像上看到发光的样子。现在有人应该控制哪个属性?
I was able to do part of what I want. However, I still can't put that "glow" look on the image. Does anybody now which property should I control?
非常感谢(并再次感谢)。
Thanks a lot (and thanks again).
推荐答案
当然。将QuartzCore框架添加到项目中,然后:
Sure. Add the QuartzCore framework to your project, then:
#import <QuartzCore/QuartzCore.h>
// ...
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.cornerRadius = 4;
请注意 cornerRadius
属性仅可用在OS 3.0及更高版本中;如果你支持旧版本(你可能不必这样做),你需要做一些核心图形工作。
Note that the cornerRadius
property is only available in OS 3.0 and later; if you're supporting an older version (which you probably don't have to be), you'll need to do some Core Graphics work.
这篇关于在iPhone中预览圆形图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!