VectorDrawable causes NumberFormatException

牧云@^-^@ 提交于 2019-12-03 15:57:50

The reason for that is not absolutely clear for me, but here is what I know: The svg standard allows to omit leading zeros for optimization. This is the root cause, because it seems that it is also allowed to concat them as often you like to 0.1 0.2 0.3 can been written as .1.2.3 the parser of Android does not handle this. All SVG display tools I know have no problem with that. So you just need to add some spaces to your path. I wrote this regular expression which you may have to run multiple times until there are no more hits.

Just replace in Android Studio (which the Regex checkbox):

(\.\d+)(\.\d)

by

$1 $2

That will solve your problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!