//fatherView加虚线边框 -(void)boundingRectangleForView:(UIView *)fatherView{ CAShapeLayer *borderLayer = [CAShapeLayer layer]; borderLayer.fillColor = [UIColor clearColor].CGColor; borderLayer.strokeColor = [UIColor nvColorWith666].CGColor; borderLayer.path = [UIBezierPath bezierPathWithRect:fatherView.bounds].CGPath; borderLayer.lineWidth = .f; borderLayer.lineCap = @"square"; borderLayer.lineDashPattern = @[@, @]; [fatherView.layer addSublayer:borderLayer]; }