【发布时间】:2011-05-17 21:51:12
【问题描述】:
我有点不知所措。我已经使用 UIView 的 layer 属性来圆我应用程序中多个元素的角。但是,这一个 UIImageView 根本不符合要求。不知道我错过了什么。
UIImageView(称为 previewImage)包含在 Table View Cell 中。我尝试将cornerRadius 属性设置为多个位置(在单元格本身和创建单元格的控制器中)无济于事。
static NSString *CellIdentifier = @"MyTableViewCell";
MyTableViewCell *cell = (MyTableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:CellIdentifier owner:self options:nil];
cell = [topLevelObjects objectAtIndex:0];
cell.previewImage.layer.cornerRadius = 20; //Made it 20 to make sure it's obvious.
}
我缺少关于加载单元格的方式吗?
【问题讨论】:
标签: iphone ios uiimageview rounded-corners