Reputation: 520
I've installed react-native-vecotor
. And when using them, they showing obscure symbols. How to use this library ? Platform: Android
import React from 'react';
import {View, Text, StyleSheet} from 'react-native';
import Icon from 'react-native-vector-icons/Ionicons';
const SearchBar = () => {
return (
<View style={styles.background}>
<Icon name="md-body" color='#000' size={25} />
</View>
);
};
const styles = StyleSheet.create({
background:{
backgroundColor:'#F0EEEE',
marginHorizontal: 15,
height:45,
borderRadius:5,
}
});
export default SearchBar;
Upvotes: 1
Views: 2229
Reputation: 1204
If you are using react-native version 0.60++ then it must be the linking problem!
I was facing same after updating react-native, but solved by this, Follow my instructions.
Clean your gradlew (Optional but recommended)
To clean gradle go to android folder and open cmd & run gradlew clean
Go to android/app/build.gradle
add this at the end of file =>
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Now re-compile (react-native run-android) It must be working now!..
Upvotes: 4
Reputation: 4162
Ionicons
has no element name body
. You can check here react-native-vector-icons
<Icon name="ios-body" color='#000' size={25} />
Upvotes: 1