3

VGroup内の画像の下にラベルを中央に配置しようとしています。ラベルは左に揃えられており、Horizo​​ntalAlignがスパークコンポーネントで機能していないようです。誰もがそれを修正する方法を知っていますか?

<?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>
4

1 に答える 1

6

これを試して、

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

位置合わせを有効にするには、ラベルの幅を指定する必要があります。

于 2010-05-26T06:32:01.890 に答える