【发布时间】:2012-03-30 21:47:23
【问题描述】:
在 UIView 中绘制填充(!)半圆的最佳方法是什么?我玩过 CGContextAddArc 函数,但它似乎没有提供填充。这是我喜欢画的 - 两个实心半圆。
【问题讨论】:
标签: ios uiview core-graphics
在 UIView 中绘制填充(!)半圆的最佳方法是什么?我玩过 CGContextAddArc 函数,但它似乎没有提供填充。这是我喜欢画的 - 两个实心半圆。
【问题讨论】:
标签: ios uiview core-graphics
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);
【讨论】:
CGContextRef gc = UIGraphicsGetCurrentContext(); 定义 cg 以使其工作