diff --git a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m index 21134261..a6ceda6f 100644 --- a/doric-iOS/Pod/Classes/Shader/DoricLayouts.m +++ b/doric-iOS/Pod/Classes/Shader/DoricLayouts.m @@ -258,6 +258,23 @@ - (void)setFrame { CGPathRef path = DoricCreateRoundedRectPath(self.view.bounds, self.corners.top, self.corners.left, self.corners.bottom, self.corners.right); shapeLayer.path = path; + + if ((self.corners.left != self.corners.right + || self.corners.left != self.corners.top + || self.corners.left != self.corners.bottom) + && self.view.layer.borderWidth > CGFLOAT_MIN) { + CAShapeLayer *lineLayer = [CAShapeLayer layer]; + lineLayer.lineWidth = self.view.layer.borderWidth * 2; + lineLayer.strokeColor = self.view.layer.borderColor; + lineLayer.path = path; + lineLayer.fillColor = nil; + [[self.view.layer sublayers] forEach:^(__kindof CALayer *obj) { + if ([obj isKindOfClass:CAShapeLayer.class] && ((CAShapeLayer *) obj).lineWidth > CGFLOAT_MIN) { + [obj removeFromSuperlayer]; + } + }]; + [self.view.layer addSublayer:lineLayer]; + } CGPathRelease(path); self.view.layer.mask = shapeLayer; }