如何定义在Android XML文件绘制一个圆形?圆形、定义、文件、XML

2023-09-05 05:25:06 作者:七分帅三分拽

我有一些问题,查找形状的定义的XML对于Android的文档。我想定义一个简单的圆圈在XML文件中填充纯色把它列入到我的布局文件。

I have some problems finding the documentation of the definitions of shapes in XML for Android. I would like to define a simple circle filled with a solid color in an XML File to include it into my layout files.

可悲的是在android.com文档不包括Shape类的XML属性。我想我应该用一个ArcShape画一个圆,但没有对如何设置大小,颜色,或者需要做出一个圆了圆弧的角度没有解释。

Sadly the Documentation on android.com does not cover the XML attributes of the Shape classes. I think I should use an ArcShape to draw a circle but there is no explanation on how to set the size, the color, or the angle needed to make a circle out of an Arc.

推荐答案

这不是真的ShapeDrawable没有XML重新presentation。 这里就是你要找的内容。

It's not true ShapeDrawable doesn't have XML representation. Here's what you're looking for.

 
精彩推荐
图片推荐