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

后端 未结 9 1121
盖世英雄少女心
盖世英雄少女心 2020-11-29 18:15

I need to draw an outline for a rounded rectangle. I know I can make lines and arcs, but maybe there is also a function for rounded rects?

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 18:30

    If you want To have rounded corners on any UIView (or subclass) the easy way is to set the cornerRadius property on the view's layer. See Preview rounded image in iphone

提交回复
热议问题