布局——基本约束

来源:互联网 发布:实况泽罗伯托巅峰数据 编辑:程序博客网 时间:2024/06/15 18:27

组件的top,bottom.left和right属性用于控制与相关边的距离。

horizontalCenter和verticalCenter属性控制在相应方向上与中心的距离

baseline属性用于设置组件的上边与其父容器的距离。

如:把按钮锁定在右下角

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">

<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:layout>
<s:BasicLayout/>
</s:layout>
<s:Button label="Hello!" bottom="5" right="5"/>
</s:Application>

0 0
原创粉丝点击