我用这段代码创建了一个带有漂亮阴影的圆圈(我在 iPhone 上使用 MonoTouch.net,Objective-C 的答案当然很好)
UIGraphics.PushContext (ctx);
SizeF shadowSize = new SizeF (0f, -3f);
ctx.SetRGBFillColor (194f / 255f, 212f / 255f, 238f / 255f, 1f);
ctx.SetAllowsAntialiasing (true);
ctx.SetShadowWithColor (shadowSize, 20, new CGColor (0.9f, 0.7f));
RectangleF area = new RectangleF (35f, 15f, 210f, 210f);
ctx.FillEllipseInRect (area);
UIGraphics.PopContext ();
然后我想添加一个弧线和线条。当我这样做时,颜色和阴影等似乎一直存在?如何在绘制 UIView 时“重新开始”?(都在同一个 UIView 中;我正在构建图像)