我正在学习react native,在我的代码中有一个错误
import React, {Component} from 'react';
import {View, ImageBackground, StyleSheet, Text} from 'react-native';
export default class Welcome extends Component{
render() {
return (
<ImageBackground source={require('./Image_app/welcome.jpg')} style={styles.container} >
<View style={styles.container}>
<Text style={styles.headerText}>
Setting background image in react native application
</Text>
</View>
</ImageBackground>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: "center",
alignItems: 'center',
width: null,
height: null,
},
headerText: {
fontSize: 24,
textAlign: "center",
margin: 10,
color: "white",
fontWeight: "bold"
}
});这个错误是enter image description here
我的源enter image description here中的put文件夹图像
发布于 2019-03-12 12:44:17
关闭捆绑程序,删除您的node_modules,重新安装npm i的所有内容,然后重新启动捆绑程序。这应该会解决你的问题。
https://stackoverflow.com/questions/55114019
复制相似问题