简体   繁体   English

使用此形状创建 xml 可绘制资源

[英]Create an xml drawable resource with this shape

在此处输入图像描述

Can any one help me with the code to draw this shape in xml谁能帮我用代码在 xml 中绘制这个形状

You can create your own shape using https://editor.method.ac/ and save as a Image, so you can get a SVG file as a output.您可以使用https://editor.method.ac/创建自己的形状并保存为图像,因此您可以获得 SVG 文件作为 output。

After creating your shape as a SVG, you can add this SVG as a Vector Asset in you android app drawable folder from app->New->Vector Asset将形状创建为 SVG 后,您可以将此 SVG 作为矢量资源添加到 android 应用程序可绘制文件夹中,从app->New->Vector Asset

In opened dialog for vector asset set the below detail and create xml for svg.在打开的矢量资产对话框中设置以下详细信息并为 svg 创建 xml。

Asset Type : Local file
Name : your desired xml file name
Path : SVG file path

So now you can use this xml in your code.所以现在你可以在你的代码中使用这个 xml。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM