1. John
    John avatar
    2 posts
    Member since:
    Feb 2017

    Posted 17 Feb Link to this post

    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!

  2. Anton Dobrev
    Admin
    Anton Dobrev avatar
    605 posts

    Posted 22 Feb Link to this post

    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.

     
Back to Top