【发布时间】:2019-11-19 11:02:27
【问题描述】:
我已经安装了react-native-vecotor。并且在使用它们时,它们会显示出晦涩的符号。如何使用这个库?平台:安卓
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;
【问题讨论】:
-
你有没有把自定义字体放到这个目录:android/app/src/main/assets?
-
@mohsen.h 不,怎么放?
-
你必须将 iconmoon.ttf 添加到这个目录的手册中,我认为它确实有效。
-
@mohsen.h 在 android/app/src/main/assets/fonts 目录中有许多扩展名为 .ttf 的文件。像 AntDesign、FontAwesome
-
目录下是否有ionicons.ttf?
标签: javascript reactjs react-native npm icons