设置RadioButton控件中文本的位置.

RadioButton控件的labelPlacement属性.
 示例:

代码:
<? xml version="1.0" encoding="utf-8" ?>
<!--  http://blog.flexexamples.com/2008/06/19/setting-the-label-placement-on-a-radiobuttongroup-in-flex/  -->
< mx:Application  xmlns:mx ="http://www.adobe.com/2006/mxml"
        layout
="vertical"
        verticalAlign
="middle"
        backgroundColor
="white" >

    
< mx:ApplicationControlBar  dock ="true" >
        
< mx:Form  styleName ="plain" >
            
< mx:FormItem  label ="labelPlacement:" >
                
< mx:ComboBox  id ="comboBox"
                        dataProvider
="[left, right, top, bottom]"
                        selectedIndex
="1"   />
            
</ mx:FormItem >
        
</ mx:Form >
    
</ mx:ApplicationControlBar >

    
< mx:RadioButtonGroup  id ="radioGroup"
            labelPlacement
=" {comboBox.selectedItem} "   />

    
< mx:HBox  horizontalAlign ="left"  verticalGap ="15" >
        
< mx:RadioButton  id ="radioButton1"
                label
="Red"
                group
=" {radioGroup} "
                opaqueBackground
="0xFF00FF"   />
        
< mx:RadioButton  id ="radioButton2"
                label
="Orange"
                group
=" {radioGroup} "
                opaqueBackground
="0xFF00FF"   />
        
< mx:RadioButton  id ="radioButton3"
                label
="Yellow"
                group
=" {radioGroup} "
                opaqueBackground
="0xFF00FF"   />
        
< mx:RadioButton  id ="radioButton4"
                label
="Green"
                group
=" {radioGroup} "
                opaqueBackground
="0xFF00FF"   />
        
< mx:RadioButton  id ="radioButton5"
                label
="Blue"
                group
=" {radioGroup} "
                opaqueBackground
="0xFF00FF"   />
    
</ mx:HBox >

</ mx:Application >

你可能感兴趣的:(RadioButton)