来自 Google REST API 的图像不会显示
Image from Google REST API won't display
在 React Native 中,我试图显示我从提取中检索到的图像(为了示例的目的,我在此处对值进行了硬编码):
<Image
source={uri:{'http://books.google.com/books/content?id=sNyBrgEACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api'}}
/>
但这不会显示任何内容...知道我该怎么做吗?
更新
当您有 uri 时,表格正确显示图像:
<Image source={{ uri: 'https://books.google.com/books/content?id=sNyBrgEACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api' }}
style={{width: 400, height: 400}}/>
查看官方文档https://facebook.github.io/react-native/releases/0.21/docs/image.html
在 React Native 中,我试图显示我从提取中检索到的图像(为了示例的目的,我在此处对值进行了硬编码):
<Image
source={uri:{'http://books.google.com/books/content?id=sNyBrgEACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api'}}
/>
但这不会显示任何内容...知道我该怎么做吗?
更新 当您有 uri 时,表格正确显示图像:
<Image source={{ uri: 'https://books.google.com/books/content?id=sNyBrgEACAAJ&printsec=frontcover&img=1&zoom=5&source=gbs_api' }}
style={{width: 400, height: 400}}/>
查看官方文档https://facebook.github.io/react-native/releases/0.21/docs/image.html