font color in react native code example
Example 1: react native text wrap
<View
style={{ flexDirection: 'row' }}
>
<Text style={{ flexShrink: 1 }}>
Really really long text...
</Text>
</View>
Example 2: 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
Example 3: react native ellipsis
<View style = { styles.MainContainer }>
<Text style={styles.TextStyle} numberOfLines = { 1 } >
This is the Sample Ellipsis Text for Ellipsis from End.
</Text>
<Text style={styles.TextStyle} numberOfLines = { 1 } ellipsizeMode = 'head'>
This is the Sample Ellipsis Text for Ellipsis from Start.
</Text>
<Text style={styles.TextStyle} numberOfLines = { 1 } ellipsizeMode = 'middle'>
This is the Sample Ellipsis Text for Ellipsis from Middle.
</Text>
</View>