本文共 570 字,大约阅读时间需要 1 分钟。
- (void)drawRect:(CGRect)rect |
{ |
// draw a rounded rect bezier path filled with blue |
CGContextRef aRef = UIGraphicsGetCurrentContext(); |
CGContextSaveGState(aRef); |
UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:rect cornerRadius:5.0f]; |
bezierPath.lineWidth = 5.0f; |
[[UIColor blackColor] setStroke]; |
|
UIColor *fillColor = [UIColor colorWithRed:0.529 green:0.808 blue:0.922 alpha:1]; // color equivalent is #87ceeb |
[fillColor setFill]; |
|
[bezierPath stroke]; |
[bezierPath fill]; |
CGContextRestoreGState(aRef); |
} |
转载于:https://www.cnblogs.com/wcLT/p/4753954.html