【发布时间】:2013-07-22 12:16:34
【问题描述】:
我正在尝试在 UIView 下添加一些阴影。
在drawRect 中,我创建了一个圆角矩形贝塞尔路径,并在其上附加了一个弯曲的箭头状底部(蓝色的东西)
这是影子的代码:
...
CGContextSaveGState(context);
CGContextAddPath(context, rectPath.CGPath); // rectPath is the bezier
CGContextSetShadowWithColor(context,shadowSize, 3.0, [[[UIColor blackColor] colorWithAlphaComponent:0.7]CGColor]);
CGContextFillPath(context);
CGContextRestoreGState(context);
...
如您所见,阴影在底部被切断,即视图框架结束的地方。我可以将阴影延伸到框架“外部”吗?
【问题讨论】:
标签: ios uiview core-graphics shadow