fontweight in react native code example
Example 1: react native italic text
<View flex={1}>
<Text style={style}>Example of Italic Text</Text>
</View>
const style = StyleSheet.create({
textAlign: 'center',
fontWeight: 'bold'
fontStyle: 'italic'
fontSize: 20,
});
Example 2: font weight react native
subWarningText: {
color: '#5460C8',
fontWeight: Platform.OS === 'android' ? 'normal' : '400',
fontSize: 14 / fontScale,
marginLeft: scaleWidth(24),
marginRight: scaleWidth(10),
marginBottom: scaleHeight(276),
},
Example 3: color text react native
<Text
style={styles.headline}>Hi, Lunox!
</Text>
headline: {
color: 'white',
textAlign: 'center',
fontWeight: 'bold',
fontSize: 50,
backgroundColor: 'purple',
}
Look how I use it here:
https://github.com/Lunox-code/100dayscode-react.native/blob/master/App.js