- (void)addDottedLineFromImageView:(UIView *)bView {
? ? bView.layer.cornerRadius = 4;
? ? CAShapeLayer*borderLayer =? [[CAShapeLayeralloc]init];
? ? borderLayer.bounds= bView.bounds;
? ? borderLayer.position=CGPointMake(bView.centerX, bView.centerY);
? ? borderLayer.path = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0,0, 68, 68) cornerRadius:4].CGPath;
? ? borderLayer.lineWidth=1;
? ? //虛線邊框---小邊框的長(zhǎng)度
? ? borderLayer.lineDashPattern = @[@6,@4]; //前邊是虛線的長(zhǎng)度,后邊是虛線之間空隙的長(zhǎng)度
? ? borderLayer.lineDashPhase=0.1;
? ? borderLayer.fillColor=UIColor.clearColor.CGColor;
? ? borderLayer.strokeColor=BSHexColor(0xA6A8AB).CGColor;
? ? [bView.layeraddSublayer:borderLayer];
}
