mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-26 23:24:06 +08:00
Only make backgroundColor opaque if non-nil
Summary: public Do not set a default backgroundColor of white when top-level RCTShadowText has backgroundColor == nil. Reviewed By: nicklockwood Differential Revision: D2605636 fb-gh-sync-id: f2076d302e7ed574f7804080ccc80db1c9b9401c
This commit is contained in:
committed by
facebook-github-bot-3
parent
6b9e4ec4b2
commit
c357943dfb
@@ -155,7 +155,7 @@ static css_dim_t RCTMeasure(void *context, float width)
|
||||
letterSpacing:nil
|
||||
useBackgroundColor:NO
|
||||
foregroundColor:self.color ?: [UIColor blackColor]
|
||||
backgroundColor:self.backgroundColor ?: [UIColor whiteColor]
|
||||
backgroundColor:self.backgroundColor
|
||||
opacity:self.opacity];
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ static css_dim_t RCTMeasure(void *context, float width)
|
||||
if (_isHighlighted) {
|
||||
[self _addAttribute:RCTIsHighlightedAttributeName withValue:@YES toAttributedString:attributedString];
|
||||
}
|
||||
if (useBackgroundColor) {
|
||||
if (useBackgroundColor && backgroundColor) {
|
||||
[self _addAttribute:NSBackgroundColorAttributeName
|
||||
withValue:[backgroundColor colorWithAlphaComponent:CGColorGetAlpha(backgroundColor.CGColor) * opacity]
|
||||
toAttributedString:attributedString];
|
||||
|
||||
Reference in New Issue
Block a user