Flex Gumbo中如何通过skinClass样式自定义FxButton的Skin的例子
By Minidxer | July 21, 2009
接下来的例子演示了Flex Gumbo中如何通过skinClass样式,自定义FxButton的Skin。
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <FxApplication name="FxButton_skinClass_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- backgroundColor="white">
- <layout>
- <BasicLayout />
- </layout>
- <FxButton label="FxButton"
- horizontalCenter="0"
- verticalCenter="0"
- skinClass="MyExternalSkin" />
- </FxApplication>
下面是MyExternalSkin.mxml的代码:
- <?xml version="1.0" encoding="utf-8"?>
- <Skin xmlns="http://ns.adobe.com/mxml/2009" resizeMode="scale">
- <states>
- <State name="up"/>
- <State name="over"/>
- <State name="down"/>
- <State name="disabled"/>
- </states>
- <Metadata>[HostComponent("mx.components.FxButton")]</Metadata>
- <Path data.up="M 0 0 L 10 0 L 10 10 L 0 10 Z"
- data.over="M 0 0 L 20 0 L 20 20 L 0 20 Z"
- data.down="M 0 0 L 30 0 L 30 30 L 0 30 Z">
- <fill>
- <SolidColor color="#000000"/>
- </fill>
- </Path>
- </Skin>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
FxButton, Gumbo |
2 Comments » |
Tags: className, Gumbo, skinClass
能给我所有的demo吗 ?非常感谢
Trackbacks