2010-03-15 56 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這可能是有用的。