如何对齐“Label:”后跟RadioButtonGroup?

时间:2011-08-30 08:07:13

标签: flex flex4 radio-button label flex4.5

请告诉我,如何在Flex 4.5中对齐标签后跟单选按钮:

enter image description here

Radio Test.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>

必须有一些标准方法......

1 个答案:

答案 0 :(得分: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>