SVG support on Android

2020-01-26 03:38发布

Does Android support SVG? any example?

标签: android svg
11条回答
可以哭但决不认输i
2楼-- · 2020-01-26 04:05

I've just chucked up a Github repo and example repo for my own TPSVG library, which I originally created specifically for an application of mine.

https://github.com/TrevorPage/TPSVG_Android_SVG_Library

https://github.com/TrevorPage/TPSVG_Example1

查看更多
▲ chillily
3楼-- · 2020-01-26 04:12

Opera Mobile for Android supports svg, and Opera Mini supports static svg content.

查看更多
Juvenile、少年°
4楼-- · 2020-01-26 04:16

Android supports vector drawables: https://developer.android.com/reference/android/graphics/drawable/VectorDrawable.html

And there exists an Android SVG to VectorDrawable Converter: http://inloop.github.io/svg2android/

查看更多
我欲成王,谁敢阻挡
5楼-- · 2020-01-26 04:17

There is a new library (under active development) androidsvg which allows one to incorporate svg images directly in to projects. It has the advantage of defining an SVGImageView which allows one to incorporate an svg directly in the layout xml.

Finally, including svg in android is straightforward.

More details: Stack Overflow post

查看更多
再贱就再见
6楼-- · 2020-01-26 04:17

Check out Support vector drawable. Android studio has a tool to convert SVG files to .XML files.

when using AppCompat with ImageView (or subclasses such as ImageButton and FloatingActionButton), you’ll be able to use the new app:srcCompat attribute to reference vector drawables (as well as any other drawable available to android:src):

As of Android Support Library 23.3.0, support vector drawables can only be loaded via app:srcCompat or setImageResource()

查看更多
Viruses.
7楼-- · 2020-01-26 04:17

Firefox for Android supports SVG.

查看更多
登录 后发表回答