开发者

Setting a default skin for a custom component in Flex 4

开发者 https://www.devze.com 2023-01-11 21:47 出处:网络
How do you set the default value of skinClass for a custom component in Flex? I\'ve extended the DropDownList with my custom component, but I would like to specify a default skin to go with it instead

How do you set the default value of skinClass for a custom component in Flex? I've extended the DropDownList with my custom component, but I would like to specify a default skin to go with it instead of always setting the skinCl开发者_JS百科ass value for each instance.


You can use css to apply a skin to a component class like so:

@namespace component "com.domain.project.view.component.*";

component|CustomComponent {
    skin-class: ClassReference("com.domain.project.view.skin.CustomSkin");
}

Or if you want it within your component code, you can set the style in the constructor:

public function CustomComponent()
{
  super();
  setStyle("skinClass", CustomSkin);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消