简体   繁体   中英

Draw a filled semi circle

What's the best method to draw a filled (!) semi circle in a UIView? I played around with the CGContextAddArc function but it does not seem to provide the filling. Here's what I like to draw - two filled semi circles.

在此处输入图片说明

CGContextBeginPath(gc);
CGContextAddArc(gc, 100, 100, 50, -M_PI_2, M_PI_2, 1);
CGContextClosePath(gc); // could be omitted
CGContextSetFillColorWithColor(gc, [UIColor cyanColor].CGColor);
CGContextFillPath(gc);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM