定义ComboBox(下拉列表)组件垂直滚动条的样式。
dropdownStyleName样式和
verticalScrollBarStyleName
样式.的学习示例: 代码:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/12/29/styling-a-flex-3-combobox-controls-vertical-scroll-bars/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Style>
.myCustomComboBox {
dropdownStyleName: myCustomDropdown;
}
.myCustomDropdown {
fontWeight: normal;
verticalScrollBarStyleName: myCustomVertScroll;
}
.myCustomVertScroll {
trackColors: white, white;
upArrowSkin: Embed("bullet_delete.png");
downArrowSkin: Embed("bullet_add.png");
}
</mx:Style>
<mx:Array id="arr">
<mx:Object label="One" />
<mx:Object label="Two" />
<mx:Object label="Three" />
<mx:Object label="Four" />
<mx:Object label="Five" />
<mx:Object label="Six" />
<mx:Object label="Seven" />
</mx:Array>
<mx:Form>
<mx:FormItem label="default:">
<mx:ComboBox id="comboBox1"
dataProvider="{arr}" />
</mx:FormItem>
<mx:FormItem label="skinned:">
<mx:ComboBox id="comboBox2"
dataProvider="{arr}"
styleName="myCustomComboBox" />
</mx:FormItem>
</mx:Form>
</mx:Application>
<!-- http://blog.flexexamples.com/2007/12/29/styling-a-flex-3-combobox-controls-vertical-scroll-bars/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
verticalAlign="top"
backgroundColor="white">
<mx:Style>
.myCustomComboBox {
dropdownStyleName: myCustomDropdown;
}
.myCustomDropdown {
fontWeight: normal;
verticalScrollBarStyleName: myCustomVertScroll;
}
.myCustomVertScroll {
trackColors: white, white;
upArrowSkin: Embed("bullet_delete.png");
downArrowSkin: Embed("bullet_add.png");
}
</mx:Style>
<mx:Array id="arr">
<mx:Object label="One" />
<mx:Object label="Two" />
<mx:Object label="Three" />
<mx:Object label="Four" />
<mx:Object label="Five" />
<mx:Object label="Six" />
<mx:Object label="Seven" />
</mx:Array>
<mx:Form>
<mx:FormItem label="default:">
<mx:ComboBox id="comboBox1"
dataProvider="{arr}" />
</mx:FormItem>
<mx:FormItem label="skinned:">
<mx:ComboBox id="comboBox2"
dataProvider="{arr}"
styleName="myCustomComboBox" />
</mx:FormItem>
</mx:Form>
</mx:Application>