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:Group d:userLabel="Main" width="100%" height="100%">
<s:Group id="myGrp1" >
<s:Group id="myGrp2" >
<s:Group id="set1_id" >
<s:Button id="set1_lastBtn" />
< s:Group id="set2_id" >
<s:button id= "set2_firstbtn"/>
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)
set2_id.setLayoutBoundsPosition(set1_lastbtn.x,set1_lastbtn.y); //the second group (set2) should start after last element of set1
//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 ?
You can use constraint-based layout to determine the position of your components so that it doesn't matter the width and height of your application, it will maintain the same position.
Hope it helps you!