Friday, May 30, 2008

Sometimes cornerRadius just isn't enough

Two tips for coders new to Flex... if you want to have rounded corners in mx.containers like VBox, HBox, Canvas, etc, set the borderStyle to solid and the borderThickness to 0, and then set your cornerRadius to whatever you want. If the borderStyle is left at none (default), the cornerRadius attribute seems broken and ineffective.

The second tip, if you want rounded corners at the top and bottom of your Panel, there's a property called roundedBottomCorners which defaults to false. When set to true, you will see rounding both top and bottom.

Here's an example http://www.crazedcoders.com/demos/rounded/

I should point out that this has been blogged previously here.

5 comments:

Vik said...

Thankx a lot!!!

That helped me too...

Anonymous said...

you rock! thanks so much for posting this. i never would have guessed that's how to make rounded corners work with canvas. i struggled with it for an hour before i found your post. big ups.

Alek83 said...

Really thanks!

leusas said...

Thanks, helped me too

Anonymous said...

I've run into this numerous times, and I always seem to forget. Thanks for reminding me!

As I remember, the dropShadow property has similar issues.