我想通过编辑headerColor样式来更改datagrid标题的颜色。除了headerColor之外,我可以更改字体大小,字体系列等。有人会帮助我吗?非常感谢。Flex datagrid headerColor风格不起作用
我的代码
MXML
<mx:DataGrid id="dataGrid" creationComplete="dataGrid_creationCompleteHandler(event)" dataProvider="{cityinfoResult3.lastResult}">
<mx:columns>
<mx:DataGridColumn headerText="Detail" dataField="detail"/>
<mx:DataGridColumn headerText="Name" dataField="name"/>
</mx:columns>
</mx:DataGrid>
样式
#dataGrid{
headerColors: #ff6600; //everything works except this one. The color can't be
//changed?
rollOverColor: #33ccff;
textRollOverColor: #ffffff;
iconColor: #ff0000;
fontFamily: Arial;
fontSize:12;
dropShadowEnabled: true;
alternatingItemColors: #330099, #0000cc;
color: #ffffff;
borderColor: #ffffff;
}
泰再次帮助我。我试过你的代码,但它给了我风格的语法错误。我使用了“headerColors:#ff6600,#ffffff;”错误消失了,但颜色不能改变...... :( – FlyingCat 2010-06-16 02:51:31
)如果你使用Halo主题,headerColors只支持Flex 4,所以你可能需要添加编译器参数-theme = $ {flexlib } /themes/Halo/halo.swc。一旦我做到了,颜色出现了。 – JeffryHouser 2010-06-16 12:34:36
hm ...我相信我必须像下面那样添加它.. -locale en_US -theme = $ {flexlib}/themes/Halo/halo.swc。编译器给了我很多警告,说:“风格”borderColor“只支持类型'spark.component.panel'与主题spark”,并且不能呈现我的应用程序.... – FlyingCat 2010-06-16 14:31:59