【发布时间】:2020-09-08 01:05:57
【问题描述】:
我的本地图片突然停止在我的应用中显示。
我尝试了这里提出的解决方案:https://stackoverflow.com/questions/35354998/react-native-ios-app-not-showing-static-assets-images-after-deploying 但它没有用。
我正在按如下方式导入我的图像:
import image from '../../assets/images/home-1.jpg';
...
return (
<SafeAreaView style={[styles.container, {margin: 0}]}>
<Image source={image} style={styles.image} />
...
</SafeAreaView>
);
...
const styles = StyleSheet.create({
image: {
backgroundColor: 'red',
width: 300,
height: 300,
},
...
有什么问题?
【问题讨论】:
标签: react-native