2011-08-30 56 views
1

請告訴我,如何使標籤,然後在單選按鈕的Flex 4.5:如何對齊「標籤:」後跟RadioButtonGroup?

enter image description here

RadioTest.mxml:

<?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> 
     <s:RadioButtonGroup id="_group" itemClick=""/> 
    </fx:Declarations> 

    <s:HGroup> 
     <s:Label text="Playing tables:" verticalAlign="bottom" /> 
     <s:RadioButton groupName="_group" label="All" /> 
     <s:RadioButton groupName="_group" label="Vacant" /> 
     <s:RadioButton groupName="_group" label="Full" /> 
    </s:HGroup> 
</s:Application> 

必須有一些標準的方法來這...

回答

5

只需將verticalAlign="baseline"添加到HGroup即可:

<?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> 
     <s:RadioButtonGroup id="_group" itemClick=""/> 
    </fx:Declarations> 

    <s:HGroup verticalAlign="baseline"> 
     <s:Label text="Playing tables:" verticalAlign="bottom" /> 
     <s:RadioButton groupName="_group" label="All" /> 
     <s:RadioButton groupName="_group" label="Vacant" /> 
     <s:RadioButton groupName="_group" label="Full" /> 
    </s:HGroup> 
</s:Application> 
+0

謝謝,這個作品。這是否使用「labelDisplay」ID,我在itemRenderer文檔中看到過? –

+0

對不起,我不明白你的問題。請提供更多詳細信息:) – Constantiner

+0

沒關係,我只是因爲吸收了太多的Flex文檔而感到困惑:-) –