2010-05-09 53 views
3

我想將我的標籤放在我的VGroup內部的圖像下方。標籤現在對齊左側,看起來像Horizo​​ntalAlign不適用於Spark組件。任何人都知道如何解決它?Flex中的VGroup中的中心標籤實例

<?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> 
     <!-- Place non-visual elements (e.g., services, value objects) here --> 
    </fx:Declarations> 
    <s:VGroup width="800"> 

     <mx:Image source="images/big/city1.jpg"/> 
     <s:Label text="test1" horizontalCenter="0" /> //doesn't work....:(
     <s:Label text="test2" /> 


    </s:VGroup> 

</s:Application> 

回答

6

試試這個,

<s:Label text="test1" width="100%" textAlign="center" /> 

你需要指定順序標籤的寬度生效的對齊。