2012-05-04 22 views
0

私は次の4つのラベルをページに配置しています。ラベルの幅を動的に変更

<s:Label id="lblName" x="10" y="13" text="{data.name}"/> 
    <s:Label id="lblComputer" x="10" y="37.5" text="{data.computer}"/> 
    <s:Label id="lblModel" x="45" y="37.5" text="{data.model}"/> 
    <s:Label id="lblCPU" x="43" y="63" text="{data.cpu}"/> 

私はこのように見えるようにレイアウトを取得しようとしている:

lblName

lblComputer lblModel

lblCPU

lblComputer場合、それは動作します短いです多くの文字がある場合、lblComputerとlblModelは一緒に実行され、完全に読み取れません。

lblComputerが本当に長くなった場合、lblModelのx値をlblComputerの「部屋を作る」ように動的に変更する方法はありますか?

おかげ

答えて

3

あなたがVGroupコンテナとのhgroupにそれらを入れて、Xを削除することができ、Yフレックスはポジショニングを処理します。

<s:VGroup> 
    <s:Label id="lblName" text="{data.name}"/> 
    <s:HGroup> 
     <s:Label id="lblComputer" text="{data.computer}"/> 
     <s:Label id="lblModel" text="{data.model}"/> 
    </s:HGroup> 
    <s:Label id="lblCPU" text="{data.cpu}"/> 
</s:VGroup> 
+0

完了!ありがとう! – SkyeBoniwell

関連する問題