我正在使用React Native编写代码,但在使用react-icon时,我仍然不知道如何在我的项目中导入图标。我尝试了使用Image等组件,但是我没有在屏幕上看到它们。
请帮助我,下面是我的代码:
import { StyleSheet,Image, View, } from 'react-native';
import { AiOutlineHome } from 'react-icons/ai';
export function Navbar() {
return (
<View style={style.nav}>
<Image
style={style.navIcon}
source={<AiOutlineHome/>}
/>
</View>
)
}
const style = StyleSheet.create({
nav:{
width:'100%',
height:50,
position:'absolute',
top:702,
},
navIcon:{
color:'red',
resize:'cover'
}
})
<View style={style.nav}><AiOutlineHome /></View>
? - Claiespath
的视图配置获取器回调必须是一个函数'。 - Leonardo