The form and the buttons overlap as the application grows smaller, for example.
<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".
This user guide is licensed for use under the terms of the Creative Commons Attribution
Non-Commercial 3.0 License.
This License allows users to copy, distribute, and transmit the user guide for noncommercial
purposes only so long as
(1) proper attribution to Adobe is given as the owner of the user guide; and
(2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms.
The best way to provide notice is to include the following link.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/
-->
<!-- components\ConstraintLayout.mxml -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:s="library://ns.adobe.com/flex/spark">
<s:layout>
<s:VerticalLayout />
</s:layout>
<s:SkinnableContainer width="100%" height="100%">
<!-- Anchor the top of the form at the top of the canvas.
Anchor the form sides 20 pixels from the canvas sides. -->
<mx:Form id="myForm" backgroundColor="#DDDDDD" top="0" left="20"
right="20">
<mx:FormItem label="Product:" width="100%">
<!-- Specify a fixed width to keep the ComboBox control from
resizing as you change the application size. -->
<mx:ComboBox width="200" />
</mx:FormItem>
<mx:FormItem label="User" width="100%">
<mx:ComboBox width="200" />
</mx:FormItem>
<mx:FormItem label="Date">
<mx:DateField />
</mx:FormItem>
<mx:FormItem width="100%" direction="horizontal" label="Hours:">
<s:TextInput width="75" />
<mx:Label text="Minutes" width="48" />
<s:TextInput width="75" />
</mx:FormItem>
</mx:Form>
<!-- Anchor the box with the buttons 20 pixels from the canvas
right edge and 10 pixels from the bottom. -->
<s:SkinnableContainer id="okCancelBox" right="20" bottom="10">
<s:layout>
<s:HorizontalLayout />
</s:layout>
<s:Button label="OK" />
<s:Button label="Cancel" />
</s:SkinnableContainer>
</s:SkinnableContainer>
</s:Application>
Related examples in the same category