可能重复: How to draw a rounded rectangle in Core Graphics / Quartz 2D?
我想以编程方式为我覆盖的UIView绘制一个圆角矩形,
我该怎么做?
NSBezierPath有一个特殊的+bezierPathWithRoundedRect:xRadius:yRadius:
,请查看文档。
NSBezierPath *path =
[NSBezierPath bezierPathWithRoundedRect:NSMakeRect(...)
xRadius:3.0f
yRadius:3.0f];
[path fill];