2012-05-04 4 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}"/> 

I는 다음과 같이 할 레이아웃을 얻으려고 :

lblName

lblComputer lblModel이

lblCPU이

그것은 lblComputer 경우 작동 짧다. 이름이 있지만 문자가 많은 경우 lblComputer와 lblModel이 함께 실행되어 완전히 읽을 수 없습니다.

lblComputer가 실제로 길 경우 lblModel의 x 값을 lblComputer에 대해 "공간 확보"하도록 동적으로 변경하는 방법이 있습니까?

감사

답변

3

당신은, y는 플렉스 위치를 처리 할 VGROUP 및 HGroup에 넣어와 X를 제거 할 수 있습니다;

<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

관련 문제