flex的Accordion组件头部文本居中显示

flex的Accordion组件头部文本默认是居左的,可以通过设置headerStyleName属性使之居中,另外还可以设置字体的样式等

 <?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"
width="100%" height="100%"> <fx:Script>
<![CDATA[
import mx.collections.ArrayCollection; [Bindable]
private var sex:ArrayCollection = new ArrayCollection(
[{name:"男", value:1}, {name:"女", value:2}]);
]]>
</fx:Script> <fx:Style>
.accordionHeader{textAlign:center;fontWeight:bold; fontSize:12}
</fx:Style> <mx:Accordion width="200" height="80%" left="20" top="20"
headerStyleName="accordionHeader">
<s:NavigatorContent width="100%" height="100%" label="个人信息" >
<s:VGroup width="100%" height="100%" top="10" gap="10">
<s:HGroup width="100%" horizontalAlign="center">
<s:Label text="姓名:" verticalAlign="middle" height="25"/>
<s:TextInput width="100" height="25"/>
</s:HGroup>
<s:HGroup width="100%" horizontalAlign="center">
<s:Label text="性别:" verticalAlign="middle" height="25"/>
<s:DropDownList width="100" height="25" dataProvider="{sex}"
labelField="name" prompt="保密"/>
</s:HGroup>
<s:HGroup width="100%" horizontalAlign="center">
<s:Label text="年龄:" verticalAlign="middle" height="25"/>
<s:TextInput width="100" height="25" restrict="0-9" maxChars="2"/>
</s:HGroup>
<s:HGroup width="100%" horizontalAlign="center">
<s:Label text="职业:" verticalAlign="middle" height="25"/>
<s:TextInput width="100" height="25"/>
</s:HGroup>
<s:HGroup width="100%" horizontalAlign="center">
<s:Label text="住址:" verticalAlign="middle" height="25"/>
<s:TextInput width="100" height="25"/>
</s:HGroup>
</s:VGroup>
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="情况反馈">
<s:VGroup width="100%" height="100%" top="10" gap="10"
horizontalAlign="center">
<s:Label text="个人情况反馈" verticalAlign="middle" fontWeight="bold" color="blue"/>
<s:TextArea height="80%" borderColor="black"/>
</s:VGroup>
</s:NavigatorContent>
<s:NavigatorContent width="100%" height="100%" label="提交信息">
<s:VGroup width="100%" height="100%" top="10" gap="10"
horizontalAlign="center">
<s:HGroup width="100%" horizontalAlign="center">
<s:Label text="方式:" verticalAlign="middle" height="20"/>
<s:RadioButton label="匿名" groupName="radiogroup1" selected="true"/>
<s:RadioButton label="实名" groupName="radiogroup1"/>
</s:HGroup>
<s:Button width="70%" label="提 交" fontSize="14"/>
</s:VGroup>
</s:NavigatorContent>
</mx:Accordion>
</s:Application>
上一篇:各浏览器的cookie的name个数/最大容量限制测试


下一篇:(转)TRANSFORM_TEX详解