Draw ellipse inside Rect iOS swift with layerWidth
Solution:
Want to draw an eclipse with layer width but if i change the layerwidth object must be inside the rect.So used the below code to achieve that.
CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextClearRect(ctx, rect);
CGContextSetLineWidth(ctx, self.Width);
CGRect shapeRect;
shapeRect = CGRectMake(0, 0, self.bounds.size.width, self.bounds.size.height);
CGContextClearRect(ctx, rect);
CGContextSetLineWidth(ctx, self.Width);
CGPathRef path = CGPathCreateWithRect(
CGContextRef context = UIGraphicsGetCurrentContext(); // not needed, but if you're doing other drawing, it'll be needed.
shapeRect = CGRectMake(shapeRect.origin.x+Width, shapeRect.origin.y+Width, shapeRect.size.width-(Wid
CGContextSetStrokeColorWithCol
[[UIColor clearColor] setFill];
CGContextStrokeEllipseInRect(U
break;
Comments
Post a Comment