2017-06-19 52 views
0

我想在圖像居中標籤,但它不工作Adobe Flex的中心的標籤,它停留在左上角....請幫助:在圖像

<mx:Canvas> 

     <mx:Image id="img" showEffect="Fade" completeEffect="{fader}" /> 

     <s:HGroup verticalAlign="middle" horizontalAlign="center"> 

      <mx:Label id="touchBegin" text="Touch the screen to continue" fontSize="72" /> 

     </s:HGroup> 

    </mx:Canvas> 

回答

3

我不有IDE中打開,但我敢肯定那是因爲hgroup的寬度不匹配的圖像之一的,嘗試:

<s:HGroup verticalAlign="middle" horizontalAlign="center" width="{img.width}">