重写drawRect方法
-(void)drawHu2
{
//1.获取上下文
CGContextRef ctx =UIGraphicsGetCurrentContext();
//1.1 设置线条的宽度
CGContextSetLineWidth(ctx,20);
//1.2 设置线条的起始点样式
CGContextSetLineCap(ctx,kCGLineCapButt);
//1.3 虚实切换,实线5虚线10
CGFloat length[] = {4,8};
CGContextSetLineDash(ctx,0, length, 2);
//1.4 设置颜色
[[UIColorcolorWithRed:162.0/255.0green:239.0/255.0blue:157.0/255.0alpha:1]set];
//2.设置路径
[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(numberChange:)name:@"number"object:nil];
CGFloat end = -434*M_PI/360+(508*M_PI/360*_num/100);
CGContextAddArc(ctx,ScreenW/2 ,ScreenW/2,ScreenW/2-10, -434*M_PI/360, end , 0);
//3.绘制
CGContextStrokePath(ctx);
}