android xml转换成svg,android – 将VectorDrawable转换为SVG
我遵循的步骤:android:pathData替换为dandroid:fillColor替换为fill没有fillColor的VectorDrawable中的路径在SVG中是fill =“none”.android:viewportHeight =“24”android:viewportWidth =“24”是SVG中的viewBox =“0 0 24 24”.例矢量Drawableandroid
我遵循的步骤:
android:pathData替换为d
android:fillColor替换为fill
没有fillColor的VectorDrawable中的路径在SVG中是fill =“none”.
android:viewportHeight =“24”android:viewportWidth =“24”是SVG中的viewBox =“0 0 24 24”.
例
矢量Drawable
android:width="24dp"
android:height="24dp"
android:viewportHeight="24"
android:viewportWidth="24">
android:fillColor="#ffffff"
android:pathData="M12,3L2,12h3v8h2.5v-0.8c0-1.5,3-2.2,4.5-2.2s4.5,0.8,4.5,2.2V20H19v-8h3L12,3zM12,15.2c1.2,0-2.2-1-2.2-2.2 s1-2.2,2.2-2.2s2.2,1,2.2,2.2S13.2,15.2,12,15.2z" />
SVG
width="24"
height="24"
viewBox="0 0 24 24" >
fill="#ffffff"
d="M12,3L2,12h3v8h2.5v-0.8c0-1.5,3-2.2,4.5-2.2s4.5,0.8,4.5,2.2V20H19v8h3L12,3zM12,15.2c1.2,0-2.2-1-2.2-2.2 s1-2.2,2.2-2.2s2.2,1,2.2,2.2S13.2,15.2,12,15.2z" />
魔乐社区(Modelers.cn) 是一个中立、公益的人工智能社区,提供人工智能工具、模型、数据的托管、展示与应用协同服务,为人工智能开发及爱好者搭建开放的学习交流平台。社区通过理事会方式运作,由全产业链共同建设、共同运营、共同享有,推动国产AI生态繁荣发展。
更多推荐


所有评论(0)