123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // KXMainWaitBGView.m
- // QBCS
- //
- // Created by qianbodong on 2017/7/31.
- // Copyright © 2017年 kuxuan. All rights reserved.
- //
- #import "KXMainWaitBGView.h"
- @interface KXMainWaitBGView ()
- @property (nonatomic,assign) CGFloat h1;
- @property (nonatomic,assign) CGFloat h2;
- @end
- @implementation KXMainWaitBGView
- - (id)initWithFrame:(CGRect)frame height1:(CGFloat) h1 height2:(CGFloat) h2
- {
- self = [super initWithFrame:frame];
- if (self) {
- _h1=h1;
- _h2=h2;
- }
- return self;
- }
- - (void)drawRect:(CGRect)rect
- {
- [super drawRect:rect];
-
- // CGRect frame = CGRectMake(50, 100, 12*, 100);
- // /*画填充圆
- // */
- CGContextRef context = UIGraphicsGetCurrentContext();
- [[UIColor redColor] set];
- // CGContextFillRect(context, rect);
-
- CGContextAddArc(context, 20*SCREEN_MUTI, 52*SCREEN_MUTI+_h1/2, 6*SCREEN_MUTI, 0, 2*M_PI, 0); //添加一个圆
- CGContextDrawPath(context, kCGPathFill);//绘制填充
-
- //填充圆,无边框
- // CGContextSetRGBStrokeColor(context, 255/255.0, 96/255.0, 0/255.0, 1);
- CGContextSetLineWidth(context, 1.0);
- /*边框圆
- */
- CGContextSetRGBStrokeColor(context, 255/255.0, 96/255.0, 0/255.0, 1);
- CGContextSetLineWidth(context, 1.0);
- CGContextAddArc(context, 20*SCREEN_MUTI, (52+59+10)*SCREEN_MUTI+_h1/2, 4*SCREEN_MUTI, 0, 2*M_PI, 0);
- CGContextDrawPath(context, kCGPathStroke);
-
- //画线
- CGPoint aPoints[2];//坐标点
- aPoints[0] =CGPointMake(20*SCREEN_MUTI, 58*SCREEN_MUTI+_h1/2);//坐标1
- aPoints[1] =CGPointMake(20*SCREEN_MUTI, (117)*SCREEN_MUTI+_h1/2);//坐标2
- //CGContextAddLines(CGContextRef c, const CGPoint points[],size_t count)
- //points[]坐标数组,和count大小
- CGContextAddLines(context, aPoints, 2);//添加线
- CGContextDrawPath(context, kCGPathStroke); //根据坐标绘制路径
- }
- @end
|