mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-30 17:33:21 +08:00
fontFamily, fontStyle and fontWeight support for TextInput
Summary:
fontFamily, fontWeight and fontStyle properties are being ignored for TextInput.
There's an additional issue that happens when you add secureTextEntry={true} it overrides the current font preferences (because it defaults to monospace) so we have to reapply it.
Master right now:

Demo after the fix:

Closes https://github.com/facebook/react-native/pull/6564
Differential Revision: D3081623
Pulled By: bestander
fb-gh-sync-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
fbshipit-source-id: 329cac6755b5a0dd549e546768f39efa7b7f4daa
This commit is contained in:
committed by
Facebook Github Bot 9
parent
037e9ba945
commit
41e89b4129
@@ -407,6 +407,31 @@ exports.examples = [
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'fontFamily, fontWeight and fontStyle',
|
||||
render: function() {
|
||||
return (
|
||||
<View>
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'sans-serif'}]}
|
||||
placeholder="Custom fonts like Sans-Serif are supported"
|
||||
/>
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'sans-serif', fontWeight: 'bold'}]}
|
||||
placeholder="Sans-Serif bold"
|
||||
/>
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'sans-serif', fontStyle: 'italic'}]}
|
||||
placeholder="Sans-Serif italic"
|
||||
/>
|
||||
<TextInput
|
||||
style={[styles.singleLine, {fontFamily: 'serif'}]}
|
||||
placeholder="Serif"
|
||||
/>
|
||||
</View>
|
||||
);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: 'Passwords',
|
||||
render: function() {
|
||||
|
||||
Reference in New Issue
Block a user