在 React Native 项目中,我使用以下代码从服务器获取图像并显示它。
<Image source={{uri: `https://infuraa-club.appspot.com/ImageResizer?categoryId=4844470512123904&width=400&height=400`}} style={styles.thumbnail} />
并且,样式定义为
thumbnail: {
width: 100,
height: 100,
},
一切都在Android上运行良好,但在IOS上不行
我尝试从不同的服务器加载其他图像,例如(http://books.google.com/books/content?id=PCDengEACAAJ&printsec=frontcover&img=1&zoom=1&source=gbs_api),它在两个平台上都运行良好。
不确定从我的服务器提供的图像有什么问题。
我已经尝试过的事情,
- 看了 http/https 问题
- 看了http头
- 从我的服务器加载其他带有 JPG/PNG 扩展名的静态图像,成功了!
- 将内容类型更改为 jpg 和 png
有人可以帮我解决这个问题。