【发布时间】:2015-09-28 01:04:02
【问题描述】:
我正在尝试在我的UIIMageView 周围创建一个边框,这是一个使用cornerRadius 的完美圆。我看过的所有内容都表明我的代码是正确的,但它返回的更像是菱形。 (我已经导入了quartzCore,不确定是否需要)
image.layer.cornerRadius = (image.bounds.size.width/2);
image.layer.borderWidth = 5;
image.layer.borderColor = [UIColor whiteColor].CGColor;
有什么想法吗?
【问题讨论】:
-
这里的高度和宽度应该相同才能使其成为圆形。
-
UIIMageView 被限制为相同的宽度和高度。
标签: ios objective-c cocoa-touch uiimageview