How do I set the rounded corner radius of a color drawable using xml?

Posted by Jay Askren on Stack Overflow See other posts from Stack Overflow or by Jay Askren
Published on 2010-01-23T05:07:23Z Indexed on 2010/05/07 0:38 UTC
Read the original article Hit count: 283

Filed under:
|

On the android website, there is a section about color drawables. Defining these drawables in xml looks like this:

<resources>
    <drawable name="solid_red">#f00</drawable>
    <drawable name="solid_blue">#0000ff</drawable>
    <drawable name="solid_green">#f0f0</drawable>
</resources>

In the java api, they have thr following method to define rounded corners:

setCornerRadius(float radius)

Is there a way to set the rounded corners in the xml?

© Stack Overflow or respective owner

Related posts about android

Related posts about drawable