verticalCenter=“0” 表示垂直居中,horizontalCenter=0表示水平居中
<?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/mx" minWidth="955" minHeight="600">
<fx:Declarations>
<!-- 将非可视元素(例如服务、值对象)放在此处 -->
</fx:Declarations>
<s:BorderContainer horizontalCenter="0" verticalCenter="0" backgroundColor="#000000" backgroundAlpha="0.3" borderStyle="solid" borderColor="#000000" alpha="0.5" width="500" height="300">
<mx:Text text="Top Left" left="10" top="10" />
<mx:Text text="Bottom Left" left="10" bottom="10" />
<mx:Text text="Bottom Center" bottom="10" horizontalCenter="0" />
<mx:Text text="Center" horizontalCenter="0" verticalCenter="0" />
<mx:Text text="Bottom Right" right="10" bottom="10" />
<mx:Text text="Center Right" verticalCenter="0" right="10" />
<mx:Text text="Center Left " left="10" verticalCenter="0" />
<mx:Text text="Top Center" horizontalCenter="0" top="10" />
<mx:Text text="Top Right" right="10" top="10" />
</s:BorderContainer>
</s:Application>
转载于:https://blog.51cto.com/332374363/1122313