Skip to content

Commit

Permalink
fix(ios)!: make transparent as default border color
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwcg authored and hippy-actions[bot] committed Nov 23, 2023
1 parent 538aa1c commit e677e0d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions renderer/native/ios/renderer/component/view/HippyViewManager.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit e677e0d

Please sign in to comment.