Does android have *native* support SVG image as drawable resources (icons)?

后端 未结 2 1519
终归单人心
终归单人心 2021-02-04 07:10

I\'m reading and watching UI tutorial. They all talk about the fact that you need to be aware of different devices size and resolution. Therefore export your icons into several

相关标签:
2条回答
  • 2021-02-04 07:28

    Android does not support SVG rasterization. Look at libsvg-android or svg4mobile. It solves that problem.

    0 讨论(0)
  • 2021-02-04 07:39

    The answer has changed. Since version 21, Lollipop the operating system has had support for VectorDrawable. This is added to by a support library that allows you to use VectorDrawable well back into previous versions. These include support for importing most of the important SVG vector commands and having Android Studio automatically convert them to a VectorDrawable.

    Use Vector Image Assets for all versions. -- Also even in older versions it's entirely possible to do fonts. Basically you give it a font asset then load up a specific letter of the font as an icon. Since fonts are glyphs and vector glyphs at that, you can very much get vector icons pretty far back.

    https://fortawesome.github.io/Font-Awesome/icons/

    0 讨论(0)
提交回复
热议问题