CGContextRef ctx = UIGraphicsGetCurrentContext();
CGContextSaveGState(ctx);
//畫圓矩形
//設置線寬
CGContextSetLineWidth(ctx, BORDE_WIDTH);
//設置填充顏色和畫筆顏色
CGContextSetFillColorWithColor(ctx, self.color.CGColor);
CGContextSetStrokeColorWithColor(ctx, [UIColor yellowColor].CGColor);
CGPathRef clippath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake([self offsets].width,[self offsets].height, [self size].width, [self size].height) cornerRadius:CR_RADIUS].CGPath;
CGContextAddPath(ctx, clippath);
// //找到各個角點
// CGPoint p_0_0 = CGPointMake([self offsets].width, [self offsets].height);
// CGPoint p_0_1 = CGPointMake([self offsets].width + [self size].width, [self offsets].height);
// CGPoint p_1_0 = CGPointMake([self offsets].width, [self offsets].height + [self size].height);
// CGPoint p_1_1 = CGPointMake([self offsets].width + [self size].width, [self offsets].height + [self size].height);
// CGContextMoveToPoint(ctx, p_1_0.x , p_1_0.y - CR_RADIUS * 2);
// CGContextAddArcToPoint(ctx, p_0_0.x, p_0_0.y, p_0_0.x + CR_RADIUS*2, p_0_0.y, CR_RADIUS);
// CGContextAddArcToPoint(ctx, p_0_1.x, p_0_1.y, p_0_1.x, p_0_1.y + CR_RADIUS*2, CR_RADIUS);
// CGContextAddArcToPoint(ctx, p_1_1.x, p_1_1.y, p_1_1.x - CR_RADIUS*2, p_1_1.y, CR_RADIUS);
// CGContextAddArcToPoint(ctx, p_1_0.x, p_1_0.y, p_1_0.x, p_1_0.y - CR_RADIUS*2, CR_RADIUS);
CGContextClosePath(ctx);
CGContextDrawPath(ctx, kCGPathFillStroke);
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。