我有点遗憾。我已经使用UIView的图层属性四舍五入在我的应用程序中的多个元素的角落。但是,这一个UIImageView根本不符合。不知道我错过了什么。在UIImageView上设置圆角半径不起作用
UIImageView(称为previewImage)包含在表格视图单元格中。我试过设置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.
}
有没有关于我错过的单元格加载的方式?
当心这个将会是一个巨大的业绩冲击 – jjxtra 2012-08-31 23:12:23
为什么这是一个性能问题? – Michael 2013-04-28 15:01:05
@PsychoDad为什么? – 2013-08-12 13:00:11