Flex Gumbo中如何通过skinClass样式给应用添加线性填充背景颜色的例子
By Minidxer | July 27, 2009
接下来的例子演示了Flex Gumbo中如何通过skinClass样式,给应用添加线性填充背景颜色。
下面是完整代码(或点击这里察看):
下面是main.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <FxApplication name="FxApplication_skinClass_test"
- xmlns="http://ns.adobe.com/mxml/2009"
- backgroundColor="white"
- skinClass="CustomFxApplicationSkin">
- <Label text="I'm an FxApplication with a custom skinClass."
- horizontalCenter="0"
- verticalCenter="0" />
- </FxApplication>
下面是CustomFxApplicationSkin.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <Skin name="CustomFxApplicationSkin"
- xmlns="http://ns.adobe.com/mxml/2009">
- <states>
- <State name="normal" />
- <State name="disabled" />
- </states>
- <Metadata>
- [HostComponent("mx.components.FxApplication")]
- </Metadata>
- <!-- fill -->
- <Rect id="backgroundRect"
- left="0"
- right="0"
- top="0"
- bottom="0">
- <fill>
- <LinearGradient rotation="90">
- <GradientEntry color="white" />
- <GradientEntry color="haloBlue" />
- </LinearGradient>
- </fill>
- </Rect>
- <Group id="contentGroup"
- left="0"
- right="0"
- top="0"
- bottom="0" />
- </Skin>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Gumbo, Other |
No Comments » |
Tags: Gumbo, lineargradient, skinClass