Reputation: 69
I am using react native version 0.67.3
I install vector icon and i add andriod/app/build.gradle apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
but icon not showing
Upvotes: 4
Views: 12834
Reputation: 1
I have same problem but when I use
<Text><Ionicons/><Text>
Icons will show in navigation bar.
Upvotes: 0
Reputation: 2366
Use the latest version
"react-native-vector-icons": "^9.1.0",
You can add latest version of it by below command:
npm install react-native-vector-icons@latest
For Android,
write below line in your android -> app -> build.gradle
project.ext.vectoricons = [
iconFontNames: [ 'MaterialIcons.ttf', 'FontAwesome.ttf', 'MaterialCommunityIcons.ttf', 'Ionicons.ttf'] // Name of the font files you want to copy
]
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
For iOS,
cd ios & pod install
Use
import Icon from 'react-native-vector-icons/MaterialCommunityIcons';
Note: Give exact icon name from https://oblador.github.io/react-native-vector-icons/
Upvotes: 10