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>

flex的Accordion组件头部文本居中显示的更多相关文章

  1. 重写TextView,实现圆形背景,文本居中显示

    最近,在做考试试题排版,产品提出题号希望显示成圆形背景,序号文本居中显示. (有点问题:文本没有绝对居中,暂时没做处理.) 为此,我采取的方式是重写TextView的onDraw方法,绘制一个圆形背景 ...

  2. CSS文本居中显示

    因为一直为元素居中问题而困扰,所以决定把自己遇到和看到的方法记录下来,以便以后查看 如果要让inline或inline-block元素居中显示,则父元素css中包含text-align:center; ...

  3. 自定义Toast样式-两行文本居中显示

    toast可以设置自定义的view和显示位置.下面是一个简单的例子,复杂些的就是改变其布局文件就可以了. /** * @author BMR * @ClassName: ToastWithTwoTex ...

  4. ExtJS -- Grid 文本居中显示

    Reference: http://stackoverflow.com/questions/6561120/extjs-4-apply-defaults-to-all-columns-in-a-gri ...

  5. LabelControl文本居中显示

    https://www.devexpress.com/Support/Center/Question/Details/Q94915 If you set the AutoSizeMode to Non ...

  6. css 单行文本居中显示,多行文本左对齐

    父级元素 text-align:center; 自级元素 text-align:left; display:inline-block;

  7. 【Android】自定义控件让TextView的drawableLeft与文本一起居中显示

    前言 TextView的drawableLeft.drawableRight和drawableTop是一个常用.好用的属性,可以在文本的上下左右放置一个图片,而不使用更加复杂布局就能达到,我也常常喜欢 ...

  8. line-height让文本在块级元素中居中显示总结

    一.总结: line-height不仅可以用在段落文本中控制行与行之间的间距,还可以用来控制文本在li这种块级元素中的位置. 文本行间距的大小由字体的大小决定,行间距的大小的设置方法有5种方式:

  9. 让TextView的drawableLeft与文本一起居中显示

     TextView的drawableLeft.drawableRight和drawableTop是一个常用.好用的属性,可以在文本的上下左右放置一个图片,而不使用更加复杂布局就能达到,我也常常喜欢用R ...

随机推荐

  1. Redis/SSDB+Twemproxy的配置与使用(Mac/Linux平台)

    对于redis而已,相信不少的后台开发人员一直都在使用,相比memcache而已,redis不仅可以作为key-value缓存使用,而且提供了丰富的数据结构如set.list.map等,能够实现很多复 ...

  2. PHP 过滤 及 字符转换 函数

    PHP过滤html标签的内部函数. php过滤html的函数: strip_tags(string) 这样就可以过滤掉所有的html标签了. 如果想过滤掉除了<img src="&qu ...

  3. PHP自毁程序

    <?php // +---------------------------------------------------------------------- // | Kill!! // | ...

  4. hdu 4302 优先队列

    进一步学习了优先队列的用法 题意:一只小动物在直线上走,起始位置为零,之后会出现食物,动物要去距离自己最短的食物那,若两边的食物距离相等,则选择之前走的方向的食物 0 x,代表x的位置出现了食物,1代 ...

  5. Xamarin Studio支持TypeScript开发

    之前谈到"TypeScript的崛起",今天推荐的文章又再次支持了这一观点--Xamarin Studio也开始支持TypeScript的开发. 一个语言是否能够崛起,很重要的一个 ...

  6. Hadoop的mapreduce开发过程,我遇到的错误集锦(持续更新)

    1.Text包导错了. 将import com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider.Text; 改为import o ...

  7. DOM--1 遵循最佳实践

    为重用命名空间而进行规划 (function() { function $(id) { return document.getElementById(id); } function alertNode ...

  8. 寒假D3 A Find the Lost Sock

    Alice bought a lot of pairs of socks yesterday. But when she went home, she found that she has lost ...

  9. 金子上的友情[XDU1011]

    Problem 1011 - 金子上的友情 Time Limit: 1000MS   Memory Limit: 65536KB   Difficulty: Total Submit: 336  Ac ...

  10. BZOJ3828 : [Poi2014]Criminals

    对于每个位置求出L[i]表示左边最大的j,满足从j开始到i-1中存在第一个子序列 R[i]表示右边最小的j,满足从j开始到i-1中存在第二个子序列 然后枚举颜色是相遇点的位置,如果L[i]左边.R[i ...