cornerRadius not working in rectangle Layout Shape?

Former Member
Former Member
I have the following drawable-list for my widget:

<drawable-list id="background" x="0" y="0" background="Gfx.COLOR_BLACK">
<shape type="rectangle" x="5" y="5" width="30" height="30" cornerRadius="8" color="Gfx.COLOR_YELLOW" />
</drawable-list>


This replaces the following view code:

dc.setColor(Gfx.COLOR_YELLOW, Gfx.COLOR_TRANSPARENT);
dc.fillRoundedRectangle(5, 5, 30, 30, 8);


However, the cornerRadius attribute in the layout is not having any effect on the shape as drawn. Is there something I am missing?
  • I was able to replicate this, and it had me confused for a moment, especially after one of the developers pointed out that we have a Drawables sample that works just fine with shapes that use a corner radius. As it turns out, the attribute name is actually 'corner_radius' instead of 'cornerRadius' like we have in the documentation. It's the same for several other attributes (e.g. border_color instead of borderColor, border_width instead of borderWidth, etc.).

    I suggest looking at the Drawables sample app that comes with the SDK for reference. I'll make sure the documentation is updated.
  • Former Member
    Former Member over 10 years ago
    That's it. Thanks.
  • Just closing the loop on this--the documentation for this has been updated, and should already be available in the 1.1.0 SDK release.