flex4 Spark DataGrid,title的字体居中

【原创】flex4 Spark DataGrid,title的字体居中

转载请加连接:http://demojava.iteye.com/blog/1459149

思路:

定义一个 headerRenderer

<s:columns>
<s:ArrayList>
<s:GridColumn dataField="name">
	<s:headerRenderer>
		<fx:Component>
			<s:DefaultGridHeaderRenderer>
				<s:labelDisplay>
					<s:Label id="labelDisplay"
						verticalCenter="1" left="0" right="0" top="0" bottom="0"
						textAlign="center" fontWeight="bold" verticalAlign="middle"
						maxDisplayedLines="1" showTruncationTip="true" />
				</s:labelDisplay>
			</s:DefaultGridHeaderRenderer>
		</fx:Component>
	</s:headerRenderer>
</s:GridColumn>

<s:GridColumn dataField="value" />
</s:ArrayList>

 

你可能感兴趣的:(datagrid)