Flex中如何利用swatchGridBackgroundColor样式设置ColorPicker的样本颜色网格背景颜色的例子
2009-01-22 11:54:57 来源:WEB开发网接下来的例子演示了Flex中如何利用swatchGridBackgroundColor样式,设置ColorPicker的样本颜色网格背景颜色。
下面是完整代码
<?xml version="1.0" encoding="utf-8"?>
<mx:Applicationxmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white"
creationComplete="init();">
<mx:Style>
.myCustomSwatchPanelStyleName {
/* border */
swatchBorderColor: white;
swatchBorderSize: 1;
/* highlight */
swatchHighlightColor: black;
swatchHighlightSize: 2;
/* gap */
horizontalGap: 2;
verticalGap: 2;
/* background */
swatchGridBackgroundColor: red;
}
</mx:Style>
<mx:Form>
<mx:FormItemlabel="default:">
<mx:ColorPicker/>
</mx:FormItem>
<mx:FormItemlabel="horizontalGap/verticalGap = 2:">
<mx:ColorPickerid="colorPicker"
swatchPanelStyleName="myCustomSwatchPanelStyleName"/>
</mx:FormItem>
</mx:Form>
</mx:Application>
更多精彩
赞助商链接