i am answering it for android And ios
download font awesome zip extract the files copy fontawesome-webfont.ttf file
make /assets/fonts/ directory in your project directory
paste fontawesome-webfont.ttf into /assets/fonts/
rename the file to fontawesome.ttf
add
"rnpm": {
"assets": [
"./assets/fonts/"
]
}
into your end of package.json file like this
- run
react-native link
command into terminal in your project directory
see reslut like this
rnpm-install info Linking assets to ios project
rnpm-install info Linking assets to android project
rnpm-install info Assets have been successfully linked to your project
- make sure run again
react-native run-android
command after successfully linked
go to fontawesome cheatsheet
copy only the character code of the icon you want to apply to a text view and paste it
<Text style={{ fontFamily: 'fontawesome', fontSize: 20 }}></Text>
apply style fontFamily: 'fontawesome'
similarly you can do it for other vector icon fonts like ionicons
and others without using third party library like react-native-vector-icons
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…