0 Replies Latest reply on Feb 2, 2012 5:32 AM by vishalkumar86

    Center align items in TileLayout

    vishalkumar86 Level 1

      Hi all,

      I am using flash builder 4.6 with sdk 4.6. I want to center align the tilelayout items. Currenlty I am using following lines of code:

       

      <s:List  itemRenderer="myRenderer"

                  xmlns:fx="http://ns.adobe.com/mxml/2009"

                  xmlns:s="library://ns.adobe.com/flex/spark"

                  xmlns:mx="library://ns.adobe.com/flex/mx"

                  borderVisible="false"

                  dataProvider="{myCollection}"

                  selectionColor="#97C330" rollOverColor="#D4E394"

                  contentBackgroundAlpha="0"

                  verticalCenter="0" horizontalCenter="0">

          <controls:layout>

              <s:TileLayout horizontalAlign="center" verticalAlign="middle"/>

          </controls:layout>

       

      The problem I am facing with it is if the list width is 100%, then the list layout its items from left whereas when there is not any width, then the list layout its items centrally.

       

      Please help if I am missing something.

       

      -Thanks and regards

           Vishal Kumar