【发布时间】:2020-01-10 22:34:45
【问题描述】:
我正在使用 Vector Asset Studio 将 SVG 文件作为 Vector Drawable 导入。每次我这样做时,它都会在生成的 XML 文件中删除我的 SVG 的“id”属性。我认为它们将被转换为 xml 文件中的“名称”属性,因为它们都是标识符。
我使用 Inkscape 创建了我的 svg,所以我可以直接绘制它。这是我的 svg 文件中的一个 sn-p:
<rect
inkscape:label="#rect1067"
y="50.32835"
x="154.16335"
height="25.92329"
width="23.673288"
id="lobby-link"
style="fill:none;fill-opacity:1;stroke:#000000;
stroke-width:0.32671064;stroke-miterlimit:4;
stroke-dasharray:none;stroke-opacity:1" />
这是生成的 xml 文件中的一个 sn-p:
<path
android:fillAlpha="1"
android:fillColor="#00000000"
android:pathData="M154.163,50.328h23.673v25.923h-23.673z"
android:strokeWidth="0.32671064"
android:strokeAlpha="1"
android:strokeColor="#000000" />
有没有办法让我实现生成的 sn-p 将包含以下内容:android:name="lobby-link"?
【问题讨论】:
标签: android android-studio android-vectordrawable