2012-06-05 90 views
0

你好,我有以下Flex代碼:讓2個progressbars重疊海誓山盟

<mx:VBox verticalGap="0"> 
    <mx:ProgressBar id="bar" labelPlacement="top" visible="true" verticalGap="0" 
        color="0x323232" label="{data.packageId}" direction="right" mode="manual"   fontWeight="bold" trackHeight="10" width="400" bottom="-4"/> 
    <mx:ProgressBar id="subbar" visible="true" width="400" label="{data.status}" verticalGap="0" 
      borderColor="#c70000" direction="right" enabled="true" top="-5" 
      indeterminate="false" labelPlacement="bottom" maximum="100" minimum="0" 
      mode="manual" themeColor="#c70000" trackHeight="3"/> 
</mx:VBox> 

眼下這兩個元件位於下海誓山盟,我想那是什麼底部進度位於頂部進度的底部。換句話說,頂部進度條的底部和底部進度條的底部應該具有相同的y值。任何幫助,將不勝感激。

回答

0

而不是強制事物不重疊的VBox,使用組。不知道你使用的是什麼版本的Flex,但假設4.0或4.5:

<s:Group> 
    <mx:ProgressBar id="bar" labelPlacement="top" visible="true" verticalGap="0" color="0x323232" label="{data.packageId}" direction="right" mode="manual" fontWeight="bold" trackHeight="10" width="400" bottom="-4"/> 
    <mx:ProgressBar id="subbar" visible="true" width="400" label="{data.status}" verticalGap="0" borderColor="#c70000" direction="right" enabled="true" top="-5" indeterminate="false" labelPlacement="bottom" maximum="100" minimum="0" mode="manual" themeColor="#c70000" trackHeight="3"/> 
</s:Group> 

從那裏你將有一個更容易定位的時間。