如何定义在Android XML文件绘制一个圆形? [英] How to define a circle shape in an android xml drawable file?

查看:892
本文介绍了如何定义在Android XML文件绘制一个圆形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题,查找形状的定义的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属性。我想我应该用一个<一个href="http://developer.android.com/reference/android/graphics/drawable/shapes/ArcShape.html">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.

这篇关于如何定义在Android XML文件绘制一个圆形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆