Flex4 css中skin设置
header-background-skin:"MySkin";
运行时报错:
TypeError: Error #1034: 强制转换类型失败:无法将 "MySkin" 转换为 Class。
at mx.controls.dataGridClasses::DataGridHeader/updateDisplayList()[E:/dev/hero_private_beta/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridHeader.as:331]
at mx.core::UIComponent/validateDisplayList()[E:/dev/hero_private_beta/frameworks/projects/framework/src/mx/core/UIComponent.as:8876]
at mx.managers::LayoutManager/validateClient()[E:/dev/hero_private_beta/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1010]
at mx.core::UIComponent/validateNow()[E:/dev/hero_private_beta/frameworks/projects/framework/src/mx/core/UIComponent.as:7953]
at mx.controls.dataGridClasses::DataGridBase/updateDisplayList()[E:/dev/hero_private_beta/frameworks/projects/mx/src/mx/controls/dataGridClasses/DataGridBase.as:594]
at mx.controls::DataGrid/updateDisplayList()[E:/dev/hero_private_beta/frameworks/projects/mx/src/mx/controls/DataGrid.as:1741]
at mx.controls.listClasses::ListBase/validateDisplayList()[E:/dev/hero_private_beta/frameworks/projects/mx/src/mx/controls/listClasses/ListBase.as:3964]
at mx.managers::LayoutManager/validateDisplayList()[E:/dev/hero_private_beta/frameworks/projects/framework/src/mx/managers/LayoutManager.as:719]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:/dev/hero_private_beta/frameworks/projects/framework/src/mx/managers/LayoutManager.as:778]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:/dev/hero_private_beta/frameworks/projects/framework/src/mx/managers/LayoutManager.as:1157]
解决办法:
header-background-skin:ClassReference("MySkin");
原理:
强行转换