nativescript - 如何修复 nativescript 中的图像标签协议错误?
问题描述
我遵循这门课程:https ://courses.nativescripting.com/courses/nativescript-core-getting-started-guide/lectures/2564661 我试图遵循,我的代码是:
<Page loaded="pageLoaded">
<ActionBar title="My App" class="action-bar"></ActionBar>
<!-- Your UI components go here -->
<Image src="~\images\apple.jpg" ></Image>
</Page>
但它没有在android模拟器中显示图片和一些消息错误:
JS: Error in downloadBitmap - java.net.MalformedURLException: no protocol: HellWorld\app\images\apple.jpg
解决方案
{N} 中的图像通常使用以下标签进行处理:
src="res://apple"
看https://docs.nativescript.org/ui/image-resources
推荐阅读
- deep-learning - 为什么加载 Pytorch 模型的损失会大大增加?
- sql-server - 不支持的密钥库提供程序在 SSMS 中键入 AZURE_KEY_STORE 创建列加密密钥
- bash - Shell 脚本:按当前日期创建文件夹并将 .png 文件移动到该子文件夹中
- ldap - 无法将 LDAP 身份验证与 JupyterHub 一起使用:Broken Pipe 错误
- sql - 将日期转换为 weekofyear 格式
- c# - 如何连接到 Cosmos MongoDb
- amazon-web-services - aws cloudformation - 权限控制/例程
- javascript - Vue.js 中的 2D 角色动画,setTimeout 的问题
- flutter - 如何从 Flutter initState() 启动 CupertinoSliverRefreshControl{}
- php - Jetstream,laravel 8电子邮件验证不起作用