/**
*获取虚线
*/
- (UIView *)getXuXianWithFrame:(CGRect)frame{
UIImageView *imageView1 = [[UIImageViewalloc]initWithFrame:frame];
UIGraphicsBeginImageContext(imageView1.frame.size); //开始画线
[imageView1.imagedrawInRect:CGRectMake(0,0, imageView1.frame.size.width, imageView1.frame.size.height)];
CGContextSetLineCap(UIGraphicsGetCurrentContext(),kCGLineCapRound); //设置线条终点形状
CGFloat lengths[] = {5,2.5};
CGContextRef line =UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(line, [UIColorgrayColor].CGColor);
CGContextSetLineDash(line,0, lengths, 2); //画虚线
CGContextMoveToPoint(line,0.0, 10.0); //开始画线
CGContextAddLineToPoint(line, imageView1.width,10.0);
CGContextStrokePath(line);
imageView1.image =UIGraphicsGetImageFromCurrentImageContext();
return imageView1;
}