[英]React-native-vector-icons show obscure symbols
I've installed react-native-vecotor
.我已经安装了
react-native-vecotor
。 And when using them, they showing obscure symbols.并且在使用它们时,它们显示出晦涩的符号。 How to use this library?
如何使用这个库? Platform: Android
平台: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;
Ionicons
has no element name body
. Ionicons
没有元素名称body
。 You can check here react-native-vector-icons你可以在这里查看react-native-vector-icons
<Icon name="ios-body" color='#000' size={25} />
If you are using react-native version 0.60++ then it must be the linking problem!如果您使用的是react-native 0.60++版本,那一定是链接问题!
I was facing same after updating react-native, but solved by this, Follow my instructions.更新 react-native 后我也面临同样的问题,但解决了这个问题,请按照我的说明进行操作。
gradlew clean
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"
Go 到
android/app/build.gradle
添加到文件末尾 => apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Now re-compile (react-native run-android/run-ios) It must be working now...现在重新编译(react-native run-android/run-ios)它现在必须工作......
I just reinstall project application from my device.我只是从我的设备重新安装项目应用程序。 It's works!
其作品!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.