android - 来自(http)的反应本机图像在发布到.apk后不会出现
问题描述
react native image from uri (http) 可以在调试过程中出现,但在发布到 apk 并安装在 android 手机上后不会出现。
<Image
source={{uri: props.img}} //props.img value is 'http://example.jpg'
style={{
flex: 1,
height: undefined,
width: undefined,
resizeMode: 'cover',
borderRadius: 10,
marginTop: 12,
}}
/>
解决方案
在 AndroidManifest.xml 中添加这个
<application
...
android:usesCleartextTraffic="true"
...>
...
</application>
推荐阅读
- python - PySpark df.persist() 损坏数据帧
- visual-studio-code - 仅在启用扩展时启用 VS Code 键盘快捷键
- python - 一个更 Pythonic(或矢量化)的函数,用于删除全部为 nan 的数组切片
- firebase - Flutter:为什么每次我重新启动我的应用程序时,登录页面都会在进入主屏幕之前短暂出现,尽管用户已经登录?
- shell - 将变量从脚本传递到我的 python 电子邮件脚本,以在邮件中在引号下输出
- php - MWS API _POST_ORDER_FULFILLMENT_DATA_ 提要不更新跟踪信息
- copy - 当我在驱动器中提供无效的 parentReference.id 时,复制/移动项目 api 不会引发异常
- visual-studio - Visual Studio 2019 锁定工具栏
- reactjs - 反应路由器 - 参数更改获取旧数据和新数据而不仅仅是新数据?
- java - 为什么用java制作的exe文件会立即关闭?