//// GeometryView.m// CNTaipingAgent//// Created by chenchen on 15/9/7.// Copyright (c) 2015年 Taiping. All rights reserved.//// 虚线边框#import "GeometryView.h"@implementationGeometryView-(void)drawRect:(CGRect)rect{CGFloatdashPattern[]={3.0,2};// 获取绘图上下文CGContextRefcontext=UIGraphicsGetCurrentContext();// 线宽CGContextSetLineWidth(context,5.0);// 画虚线CGContextSetLineDash(context,0.0,dashPattern,2);// 设置线条颜色CGContextSetStrokeColorWithColor(context,GXF_NAVIGAYION_COLOR.CGColor);// 设置填充颜色CGContextSetFillColorWithColor(context,[[UIColorwhiteColor]CGColor]);// 填充一个矩形CGContextFillRect(context,rect);// 绘制矩形边框CGContextStrokeRect(context,rect);}@end