1

Possible Duplicate:
How to draw a rounded rectangle in Core Graphics / Quartz 2D?

I want to draw a rounded rectangle programmatically for my overlaying UIView,

how would I approach this?

Cœur
  • 34,719
  • 24
  • 185
  • 251
Andyy
  • 475
  • 8
  • 26

1 Answers1

3

NSBezierPath has a special +bezierPathWithRoundedRect:xRadius:yRadius:, check the documentation.

NSBezierPath *path =
  [NSBezierPath bezierPathWithRoundedRect:NSMakeRect(...)
                                  xRadius:3.0f
                                  yRadius:3.0f];
[path fill];
sidyll
  • 54,916
  • 12
  • 100
  • 146