我有一个 UIView,我想在其中绘制一个延伸到 UIView 框架之外的 Circle,我已将 maskToBounds 设置为 NO - 期望我可以在 UIView 的边界之外在右侧和底部绘制 5 个像素。
我希望椭圆不会被剪裁,但它会被剪裁并且不会超出界限?
- (void)drawRect:(CGRect)rect
{
int width = self.bounds.size.width;
int height = self.bounds.size.height;
self.layer.masksToBounds = NO;
//// Rounded Rectangle Drawing
//// Oval Drawing
UIBezierPath* ovalPath = [UIBezierPath bezierPathWithOvalInRect: CGRectMake(0, 0, width+5, height+5)];
[[UIColor magentaColor] setFill];
[ovalPath fill];
[[UIColor blackColor] setStroke];
ovalPath.lineWidth = 1;
[ovalPath stroke];
}