我有一個UIView,我想繪製一個延伸過UIView框架的圓形, 我已經將masksToBounds設置爲NO - 期待我可以通過UIView的邊界繪製過去右側和底部5個像素。在UIView之外繪製
我希望橢圓不會被剪斷,但它確實被剪斷並且不會超出邊界?
- (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];
}
我試過 - 沒有工作... – OneGuyInDc 2013-02-18 23:24:39
self.layer.masksToBounds = NO不會幫助剪輯 – pixelrevision 2015-02-17 23:34:48