Flex Gumbo中如何利用<Style/>自定义Button和TextInput的例子
By Minidxer | August 4, 2009
接下来的例子演示了Flex Gumbo中如何利用<Style/>自定义Button和TextInput。编译本例需要5873 (4.0.0.5873) 或者更新的才可以。
下面是完整代码(或点击这里察看):
下面是main.mxml:
- <?xml version="1.0" encoding="utf-8"?>
- <s:Application name="FxGumbo_test"
- xmlns:fx="http://ns.adobe.com/mxml/2009"
- xmlns:s="library://ns.adobe.com/flex/spark"
- xmlns:mx="library://ns.adobe.com/flex/halo">
- <s:layout>
- <s:BasicLayout />
- </s:layout>
- <fx:Style>
- @namespace s "library://ns.adobe.com/flex/spark";
- @namespace mx "library://ns.adobe.com/flex/halo";
- global {
- color: red;
- fontStyle: italic;
- fontWeight: bold;
- }
- s|Button {
- baseColor: haloOrange;
- }
- mx|Button {
- baseColor: haloGreen;
- }
- </fx:Style>
- <s:VGroup horizontalCenter="0" verticalCenter="0">
- <s:Button label="I'm a Spark Button" />
- <mx:Button label="I'm a Halo Button" />
- <mx:HRule width="100%" />
- <s:TextInput text="I'm a Spark TextInput" />
- <mx:TextInput text="I'm a Halo TextInput" />
- </s:VGroup>
- <s:RichEditableText id="sdkVer"
- editable="false"
- initialize="sdkVer.text = mx_internal::VERSION;"
- bottom="10"
- right="10" />
- </s:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Button, Gumbo, TextInput |
No Comments » |
Tags: Gumbo, TextInput