UIViewのフレームを超えて伸びる円を描画したいUIViewがあり、masksToBoundsを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];
}