不知道我是否可能在某处错过了答案,但我无法弄清楚。我已逐步遵循本教程
我已安装所有最新版本的所有内容,因为该视频是 2020 年 5 月发布的。
当他在 56:43 左右添加图像时,我的图像没有出现。
这是我的代码:
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View, Image } from "react-native";
export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Image
source={{
width: 200,
height: 300,
uri: "https://picsum.photos/200/300",
}}
/>
<StatusBar style="auto" />
</View>
);
}
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: "#fff",
alignItems: "center",
justifyContent: "center",
},
});
结果是
我尝试寻找不同的解决方案,但找不到任何解决方案,任何帮助都会很棒,因为我很想学习 react-native
谢谢
