【问题标题】:How can I use images SVG in Angular with NativeScript?如何在带有 NativeScript 的 Angular 中使用图像 SVG?
【发布时间】:2020-03-16 09:48:56
【问题描述】:

当我想在带有 Angular 的 NativeScript 中使用图像 SVG 时遇到问题。我做了典型的我使用 de 标签的地方:<Image src="res://image.svg"></Image><Image src="~/images/image.svg"></Image>。在 NativeScript 中不能原生显示 SVG 格式的图像,解决方案是使用 Nativescript 的插件https://market.nativescript.org/plugins/nativescript-svg,但是这个插件目前不工作(https://github.com/peoplewareDo/nativescript-svg/issues/24)。 我只有 SVG 格式的图像,没有其他格式的图像。 我该怎么解决这个问题?

【问题讨论】:

  • 如果你擅长PNG / JPG,网上有很多工具可以转换你的图像格式。

标签: angular image svg nativescript


【解决方案1】:

在查看nativescript-svg GitHub 上提供的问题后,我确实看到一些 cmets 说bradmartin fork 适用于 Android。你试过了吗?

此外,在 NativeScript 官方存储库中,还有一个关于 svg support 的重新开放问题。因此,我建议同时将您的 svgs 文件保存为 png/jpeg 或任何其他受支持的格式。

干杯!

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-18
    • 2021-07-31
    • 2015-07-04
    • 1970-01-01
    • 2020-08-08
    • 1970-01-01
    • 2023-03-05
    相关资源
    最近更新 更多