[英]React Native, getting "Module not found: Can't resolve" error while using ImageBackground
You are using an external image, so the way is to give source
an object with uri
field instead of using require
, like so:您正在使用外部图像,因此方法是给
source
一个带有uri
字段的对象,而不是使用require
,如下所示:
<ImageBackground
source={{uri:'https://via.placeholder.com/500'}}>
resizeMode="cover"
style={styles.imgBackground}
>
<Text>Some text...</Text>
</ImageBackground>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.