how to create android:pathData?

前端 未结 2 1942
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 10:01

so i\'m going to need to use path data in my app, is there a way to convert images you already have to path data ?

or the only way is to actually calculate all the

2条回答
  •  被撕碎了的回忆
    2020-12-01 10:19

    Assuming you're referring to the pathData element of a VectorDrawable, if you have the images in .svg format you can convert them easily.

    Either do it directly in Android Studio by right-clicking on the drawable folder then New>Vector Asset and import your local SVG file:

    Or use another converter like svg2android(you might find this works on files that Android Studio fails to convert).

    If you don't want a VectorDrawable and just want to get the pathData you can open an SVG in a text editor. If the images you have aren't in a vector format already things will be more difficult.

提交回复
热议问题