我有点不知所措.我已经使用UIView的Layer属性在我的应用程序中对多个元素的角点进行了圆角处理.然而,这个UIImageView根本不符合要求.不知道我错过了什么.
UIImageView(称为previewImage)包含在表视图单元格中.我try 过将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.
}
是不是有什么关于细胞加载的方式让我遗漏了什么?