如何创建一个圆圈绘制? [英] How to create a circle drawable?

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

问题描述

如何在创建一个绘制圆的,有5个像素的蓝色笔触和透明填充。

How to a create a drawable of a circle, with blue stroke of 5 pixels and a transparent fill.

我将通过这个绘制 ItemizedOverlay

我想与code做到这一点,我就知​​道了圆的半径。

I want to do this with code and I will know the radius of the circle.

推荐答案

尝试沿着线的东西:

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
       type="OvalShape" >
   <stroke android:width="5dp" android:color="#99104E8B"/>
   ....
</shape>

只要把这样的事情在一个XML文件中可绘制你的目录,并加载它,你会一个正常的图像。

Just put something like this in an XML file in you drawables directory and load it as you would a normal image.

请参阅ShapeDrawable在Android文档。

See ShapeDrawable in the Android Docs.

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

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