【发布时间】:2013-04-12 17:29:35
【问题描述】:
嘿,我正在尝试设置cell.imageView 的cornerRadius,但它似乎不起作用。
cell.imageView.layer.cornerRadius=9;
它会起作用还是我应该在我的单元格中添加一个自定义的UIImageView 以具有圆角?
我也试过了
cell.imageView.layer.borderWidth=2;
cell.imageView.layer.borderColor=[[UIColor blackColor]CGColor];
但它似乎也不起作用。有没有人遇到过类似的问题?
【问题讨论】:
-
您还需要设置
masksToBounds。你读过CALayer文档吗? -
@Desdenova 对不起,我忘了一个基本的东西,谢谢:)。
标签: ios uitableview uiimageview