1.UIView等控件制作边框虚线
CAShapeLayer *borderLayer = [CAShapeLayer layer];
// borderLayer.bounds = _testView.bounds;
// borderLayer.position = CGPointMake(0,0);
borderLayer.path = [UIBezierPath bezierPathWithRect:CGRectMake(0,0,kScale(345),kScale(200))].CGPath;
borderLayer.lineWidth = 1;
// lineDashPattern: @8@8 画8空8. @8@8@10@10 画8空8画10空10
borderLayer.lineDashPattern = @[@8,@8];
borderLayer.fillColor = [UIColor colorWithHexString:@"#DFDFDF"].CGColor;
[_testView.layer addSublayer:borderLayer];