【发布时间】:2012-01-16 02:53:43
【问题描述】:
可能重复:
How to draw a rounded rectangle in Core Graphics / Quartz 2D?
我想以编程方式为我的叠加 UIView 绘制一个圆角矩形,
我该如何处理?
【问题讨论】:
标签: iphone ios cocoa-touch uikit core-graphics
可能重复:
How to draw a rounded rectangle in Core Graphics / Quartz 2D?
我想以编程方式为我的叠加 UIView 绘制一个圆角矩形,
我该如何处理?
【问题讨论】:
标签: iphone ios cocoa-touch uikit core-graphics
NSBezierPath 有一个特殊的+bezierPathWithRoundedRect:xRadius:yRadius:,查看文档。
NSBezierPath *path =
[NSBezierPath bezierPathWithRoundedRect:NSMakeRect(...)
xRadius:3.0f
yRadius:3.0f];
[path fill];
【讨论】: