1 Reply Latest reply on Jul 14, 2011 7:54 AM by kokorito

    IconItemRenderer with rounded Corners

    ChristophFlex

      Hi everyone,

       

      im using the mobile IconItemRenderer and need to round the corners of the list-Items to be in conform with the rest of my UI-Design. is there any way to archive this?

       

      thx for your help

        • 1. Re: IconItemRenderer with rounded Corners
          kokorito Level 4

          extend the IconIremRenderer and then override the drawBackground method and draw a rect with rounded corners

          something like this...

           

           

          package renderers
          {
              import spark.components.IconItemRenderer;
             
              public class RoundedIconItemRenderer extends IconItemRenderer
              {
                  public function RoundedIconItemRenderer()
                  {
                     
                      super();
                  }
                 
                  override protected function drawBackground(unscaledWidth:Number, unscaledHeight:Number):void
                  {
                      this.graphics.beginFill(0x000000,0.8);
                      this.graphics.lineStyle(1,0xCCCCCC,0.5);
                      this.graphics.drawRoundRect(0,0,unscaledWidth,unscaledHeight,30,30);
                      this.graphics.endFill();
                     
                     
                  }
                 
                 
              }
          }