1 Reply Latest reply on Feb 2, 2011 3:25 PM by Pablo Souza

    layout problem with spark groups

    Charan Raj Adobe Employee

      Hi,

       

      i am having some layout problem with the spark groups. i am placing the group ( and its contents ) using their x and y values and not getting expected behavior.

       

      the mail mxml file looks the following  -

       

       

      /* MXML excerpts start */

       

      <s:layout>

          <s:BasicLayout />

      </s:layout>

       

       

      <s:Group  d:userLabel="Main" width="100%" height="100%">

       

          <s:Group  id="myGrp1" >

       

          </s:Group>

       

       

       

          <s:Group id="myGrp2"  >

       

                    <s:Group id="set1_id"  >

                          <s:button  id="set1_firstbtn"/>

                          <s:BitmapImage />

                          .....

                          <s:Button id="set1_lastBtn" />

                    </s:Group>

       

       

                < s:Group id="set2_id"  >

                          <s:button  id= "set2_firstbtn"/>

                          <s:BitmapImage />

                          .....

                          <s:Button />

              </s:Group>

       

            </s:Group>

      </s:Group>

       

       

       

      in the appinit_applicationCompleteHandler (called when applicationComplete is triggered)

      i have place the group and its elements based on the given width height  say ( i am given width of 600 and height of 800 )

       

      i am doing the following

       

      function LayoutUI(width , height)

      {

          myGrp2.setLayoutBoundsPosition(0,0);

          set1_id.setLayoutBoundsPosition(myGrp2.x,myGrp2.y);

          set1_firstbtn.setLayoutBoundsPosition(set1_id.x,set1_id.y);

       

            set2_id.setLayoutBoundsPosition(set1_lastbtn.x,set1_lastbtn.y); //the second group (set2) should start after last element of set1

            set2_firstbtn.setLayoutBoundsPosition(set2_id.x,set2_id.y);

       

          .....

       

      //NOTE  - i have some of the elements of set1 group overlapped - meaning some elements might share the same x , y values. the elemtents have same width and height

      }

       

       

      /* MXML excerpts ends */

       

      the problem is the set2_firstbtn is not laid out after set1_lastbtn - it is actually getting laid out after some offset. ( the set2 seems to be starting at aheight  = height of all elements of set1_id  )  (remember i have some of elements of set1 overlapping)

       

      could you please let me know what might be the problem here ?

       

      thanks,