mirror of
https://github.com/status-im/react-native.git
synced 2025-02-03 13:14:42 +00:00
Fix background color issue
Differential Revision: D2489578 committer: Service User <svcscm@fb.com>
This commit is contained in:
parent
3a664a0008
commit
3b6d029a55
@ -310,6 +310,15 @@ var TextExample = React.createClass({
|
||||
</Text>
|
||||
</Text>
|
||||
</Text>
|
||||
<Text style={{backgroundColor: 'rgba(100, 100, 100, 0.3)'}}>
|
||||
Same alpha as background,
|
||||
<Text>
|
||||
Inherited alpha from background,
|
||||
<Text style={{backgroundColor: 'rgba(100, 100, 100, 0.3)'}}>
|
||||
Reapply alpha
|
||||
</Text>
|
||||
</Text>
|
||||
</Text>
|
||||
</UIExplorerBlock>
|
||||
<UIExplorerBlock title="containerBackgroundColor attribute">
|
||||
<View style={{flexDirection: 'row', height: 85}}>
|
||||
|
@ -221,6 +221,13 @@ exports.examples = [
|
||||
style={styles.singleLine}
|
||||
underlineColorAndroid="blue"
|
||||
/>
|
||||
<TextInput
|
||||
defaultValue="Same BackgroundColor as View "
|
||||
style={[styles.singleLine, {backgroundColor: 'rgba(100, 100, 100, 0.3)'}]}>
|
||||
<Text style={{backgroundColor: 'rgba(100, 100, 100, 0.3)'}}>
|
||||
Darker backgroundColor
|
||||
</Text>
|
||||
</TextInput>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ public class ReactTextShadowNode extends ReactShadowNode {
|
||||
// a new spannable will be wiped out
|
||||
List<SetSpanOperation> ops = new ArrayList<SetSpanOperation>();
|
||||
buildSpannedFromTextCSSNode(textCSSNode, sb, ops);
|
||||
if (textCSSNode.mFontSize == -1) {
|
||||
if (textCSSNode.mFontSize == UNSET) {
|
||||
sb.setSpan(
|
||||
new AbsoluteSizeSpan((int) Math.ceil(PixelUtil.toPixelFromSP(ViewDefaults.FONT_SIZE_SP))),
|
||||
0,
|
||||
@ -315,7 +315,8 @@ public class ReactTextShadowNode extends ReactShadowNode {
|
||||
}
|
||||
markUpdated();
|
||||
}
|
||||
if (styles.hasKey(ViewProps.BACKGROUND_COLOR)) {
|
||||
// Don't apply background color to anchor TextView since it will be applied on the View directly
|
||||
if (styles.hasKey(ViewProps.BACKGROUND_COLOR) && this.isVirtualAnchor() == false) {
|
||||
if (styles.isNull(ViewProps.BACKGROUND_COLOR)) {
|
||||
mIsBackgroundColorSet = false;
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user