android - NativeScript JS:缺少带有 resourceID 的图像 - 远程图像 API
问题描述
我正在用 angular 用 nativescript 做一个小应用程序,我用 service.ts 使用测试 api
getItems(){
return this.http.get('https://apiexample.com/url');
}
它返回带有几张图像的 json,但是当我使用这个示例并直接输入 url
<image
src="https://art.nativescript.org/logo/export/NativeScript_Logo_Blue_White.png"
stretch="aspectFill"
>
</image>
图片显示
但是当我这样使用时
<GridLayout>
<ListView [items]="items">
<ng-template let-item="item">
<StackLayout>
<image
[src]="item.img_src"
stretch="aspectFill"
loadMode="async"
>
</image>
<Label [text]="item.id"></Label>
</StackLayout>
</ng-template>
</ListView>
</GridLayout>
如果我这样写代码,它就不会再显示任何东西了。但在控制台上它告诉我JS: Missing Image with resourceID 有 什么想法吗?泰
解决方案
推荐阅读
- reactjs - React import svg 出现 TS 错误:“找不到模块 '../images/bar.svg'。”
- r - 操作数据框值以匹配不同的列
- python - 如何从服务器下载 .exe 文件并安装它
- javascript - HandleSubmit 在 Redux 表单和 React Native - 没有值打印出来
- python - lightGBM 模型上的部分依赖图 (PDPbox) 错误:“通过的项目数量错误 3,位置暗示”
- android-studio - 如何添加所有非方形的屏幕兼容图像?
- c++ - 删除包含指向另一个位置的指针的指针
- java - 以下 Java 代码中的“地址”是什么?它是单独的 Java 类还是用户定义的数据类型?
- typescript - d.ts 声明模块在导入第三方库时不起作用
- python - 具有不同开始日期的数据时间序列绘图