我想通過編輯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