This is a migrated thread and some comments may be shown as answers.

SVG

1 Answer 198 Views
HTML5, CSS, JavaScript
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
John
Top achievements
Rank 1
John asked on 17 Feb 2017, 03:35 PM

Hi everyone,

Not sure if this is the best place and if not please direct me to the proper place but what is the best way to load SVG's in via nativescript? Typically in the past I have just used CSS but looking for the most efficient solution per telerik.

Thank you in advance!

1 Answer, 1 is accepted

Sort by
0
Anton Dobrev
Telerik team
answered on 22 Feb 2017, 12:43 PM
Hello John,

After consulting with the NativeScript team, such support is not available in the framework at the current stage (my feeling is that this is mainly because it is not inherently available to the native platforms). More information on the topic is available in this feature request on GitHub.

The community is usually referring to this plugin which claims to allow loading SVG files, however, after testing it a little bit it either does not build successfully or does not load the files successfully.

If you definitely need to use SVG files in your application based on NativeScript, my suggestion would be to:

1. Use a plugin:

- Contact the plugin developer by submitting an issue on the plugin repository about the availability and compatibility of the plugin
- Import and use a native Android or iOS library (as these used in the plugin) as a plugin in your NativeScript project as explained here.

Once your plugin is ready, you can also check these prerequisites for using plugins in AppBuilder.

2. Directly access native APIs

- Access a native API that allows to do so as explained here. I am not aware, however, what native APIs have best support for loading SVG files, usually the community is using a custom library for this (as in the plugin quoted above).

As far as you are utilizing Telerik Platform for developing your project with NativeScript you are at the right place in the forums or when submitting a support ticket for any tooling, deploying or build questions. In some cases, such as consulting the support in NativeScript for some features or the usage of the framework it may also beneficial to check with the NativeScript community.

I hope that I was able to answer your question.

Regards,
Anton Dobrev
Telerik by Progress
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
HTML5, CSS, JavaScript
Asked by
John
Top achievements
Rank 1
Answers by
Anton Dobrev
Telerik team
Share this question
or