我的项目中有这组图像。
this.state.destinations = [{
"destinationId": "001",
"img": "../../assets/img/destinations/001.png"
},
{
"destinationId": "002",
"img": "../../assets/img/destinations/002.png"
},
{
"destinationId": "003",
"img": "../../assets/img/destinations/003.png"
}]
}
Run Code Online (Sandbox Code Playgroud)
我试图在 Image 组件中的 View 中重复它们中的每一个,如下所示:
render() {
var {navigate} = this.props.navigation;
return (
<LinearGradient
colors={['#514A9D', '#24C6DC']} start={[0.0, 0.5]} end={[1.0, 0.5]} locations={[0.0, 1.0]} style={{flex:1}}>
<ScrollView>
{
<View style={{paddingTop: 24}}>
{
this.state.destinations.map(dest => {
return <Image style={{height: 200, width: 600}} key={dest.destinationId} source={require(dest.img)} resizeMode="contain" />
})
}
</View>
}
</ScrollView>
</LinearGradient>
);
}
Run Code Online (Sandbox Code Playgroud)
但是当我尝试运行时,我的手机出现了一些疯狂的错误:
我试图在 expo 中运行该应用程序,我只是在 react-native 模式下开发它,而不是 react-native-init 模式。
这周我做了一个面试测试,测试结果是这样的:
将 /var/save/my-repo 目录初始化为 git 存储库,并将本地存储库设置为名为 origin 的远程存储库。执行以下一组操作:
- 查看主分支;
- 创建一个不带引号的提交消息“我的第一次提交”;
- 将更改推送到 master 分支;
我将my-repo文件夹初始化为 Git 存储库,但我不明白“将本地存储库设置为名为 origin 的远程存储库”的部分。
谁能解释我或告诉我如何实现它?