【发布时间】:2019-12-11 11:46:44
【问题描述】:
我正在尝试从我的 react-native 应用程序中的本地文件夹加载 JPG 图像。
图像存储在资产文件夹中,我试图在图像标签中呈现该文件夹
这是我的 JSON 对象
{
title: 'Device 2',
image: '../assets/imgs/device_default.jpg',
cta: 'View device',
mac: '1234-xxxx-xxxx-5678'
},
这是我的代码
<Block flex style={imgContainer}>
<Image source={{uri: item.image}} style={imageStyles} />
</Block>
这里的 item 包含 props 值。我可以迭代其他值,例如 title 和 mac
但无法渲染图像。
谁能帮我解决这个问题?
【问题讨论】:
标签: react-native react-native-android