Answers for "react native font"

4

react native text wrap

<View
    style={{ flexDirection: 'row' }}
> 
   <Text style={{ flexShrink: 1 }}>
       Really really long text...
   </Text>
</View>
Posted by: Guest on April-21-2020
1

color text react native

// Some code....
<Text 
	// Topic 2: Text Style
	style={styles.headline}>Hi, Lunox!
</Text>

// Some code....

headline: {
	color: 'white', // <-- The magic
	textAlign: 'center', // <-- The magic
	fontWeight: 'bold',
	fontSize: 50,
	backgroundColor: 'purple',
}
// Some code....

Look how I use it here:
https://github.com/Lunox-code/100dayscode-react.native/blob/master/App.js
Posted by: Guest on October-28-2020
6

custom font in react native

create folder in your root directory assets/Fonts and add your custom fonts
you want.
create a file in root folder and called react-native.config.js
Add the following code to the file =>

module.exports = {
project: {
    ios: {},
    android: {},
},
assets: ['./assets/Fonts']
};


or 
module.exports = {
    assets: ['./assets/Fonts'],
  };


Then, run the following command in your terminal:
react-native link 

to use it declare this way in your styles:
fontFamily: 'your-font-name without extension'

If your font is Raleway-Bold.ttf then,
  fontFamily: 'Raleway-Bold'
Posted by: Guest on February-13-2021
1

how to link custom fonts in react native

$ react-native link
Posted by: Guest on January-05-2021
0

added font to react native

$ npx react-native link
Posted by: Guest on August-18-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language