From e677e0d36f019abbef96d4d927f668f4a0d55818 Mon Sep 17 00:00:00 2001 From: wwwcg Date: Fri, 17 Nov 2023 17:21:51 +0800 Subject: [PATCH] fix(ios)!: make transparent as default border color --- .../renderer/component/view/HippyViewManager.mm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/renderer/native/ios/renderer/component/view/HippyViewManager.mm b/renderer/native/ios/renderer/component/view/HippyViewManager.mm index 648a702f301..0a0621426f6 100644 --- a/renderer/native/ios/renderer/component/view/HippyViewManager.mm +++ b/renderer/native/ios/renderer/component/view/HippyViewManager.mm @@ -392,10 +392,21 @@ - (void)loadImageSource:(NSString *)path forView:(HippyView *)view { } } HIPPY_CUSTOM_VIEW_PROPERTY(borderColor, CGColor, HippyView) { + CGColorRef color = nil; if ([view respondsToSelector:@selector(setBorderColor:)]) { - view.borderColor = json ? [HippyConvert CGColor:json] : defaultView.borderColor; + if (json) { + color = [HippyConvert CGColor:json]; + } else { + color = defaultView ? defaultView.borderColor : [UIColor clearColor].CGColor; + } + view.borderColor = color; } else { - view.layer.borderColor = json ? [HippyConvert CGColor:json] : defaultView.layer.borderColor; + if (json) { + color = [HippyConvert CGColor:json]; + } else { + color = defaultView ? defaultView.layer.borderColor : [UIColor clearColor].CGColor; + } + view.layer.borderColor = color; } }