Flex中如何通过strokeWidth, strokeColor和shadowColor样式创建一个自定义风格的HRule或VRule的例子
By Minidxer | October 20, 2008
接下来的例子演示了Flex中如何通过strokeWidth, strokeColor和shadowColor样式,创建一个自定义风格的HRule或VRule。
让我们先来看一下Demo(可以右键View Source或点击这里察看源代码):
下面是完整代码(或点击这里察看):
Download: main.mxml
- <?xml version="1.0" encoding="utf-8"?>
- <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
- layout="vertical"
- verticalAlign="middle"
- backgroundColor="white">
- <mx:ApplicationControlBar dock="true">
- <mx:Form>
- <mx:FormItem label="stokeWidth:">
- <mx:HSlider id="strokeWidthSlider"
- minimum="0"
- maximum="20"
- value="2"
- liveDragging="true"
- snapInterval="1"
- tickInterval="1"
- dataTipPrecision="0" />
- </mx:FormItem>
- <mx:FormItem label="strokeColor:">
- <mx:ColorPicker id="strokeColorColorPicker"
- selectedColor="red" />
- </mx:FormItem>
- <mx:FormItem label="shadowColor:">
- <mx:ColorPicker id="shadowColorColorPicker"
- selectedColor="blue" />
- </mx:FormItem>
- </mx:Form>
- </mx:ApplicationControlBar>
- <mx:HRule id="hrule"
- strokeWidth="{strokeWidthSlider.value}"
- strokeColor="{strokeColorColorPicker.selectedColor}"
- shadowColor="{shadowColorColorPicker.selectedColor}"
- width="100%" />
- </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子
Topics:
Rule |
No Comments » |
Tags: HRule, shadowColor, strokeColor, strokeWidth, VRule