[组件开发] flex 4 s:dropdownlist 垂直下拉滚动条 样式重写
来源:互联网 发布:淘宝基金欠款怎么还 编辑:程序博客网 时间:2024/05/21 17:44
主APP main.mxml:
<?xml version="1.0" encoding="utf-8"?><s:Application name="Spark_DropDownList_PopUp_placement_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"minHeight="300"skinClass="skins.ApplicationSkin"><fx:Script><![CDATA[]]></fx:Script> <!--<s:Scroller height="200">--><s:VGroup height="600"><s:DropDownList id="dropDownList"labelField="label"requireSelection="true"skinClass="skins.CustomDropDownListSkin"horizontalCenter="0"top="20"><s:dataProvider><s:ArrayList><fx:Object label="The" /><fx:Object label="Quick" /><fx:Object label="Brown" /><fx:Object label="Fox" /><fx:Object label="Jumps" /><fx:Object label="Over" /><fx:Object label="The" /><fx:Object label="Lazy" /><fx:Object label="Dog" /></s:ArrayList></s:dataProvider></s:DropDownList></s:VGroup><!--</s:Scroller>--> </s:Application>
CustomDropDownListSkin.mxml的代码:
<?xml version="1.0" encoding="utf-8"?><s:Skin name="CustomDropDownListSkin" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" alpha.disabled="0.5"> <!-- states --> <s:states> <s:State name="normal" /> <s:State name="open" /> <s:State name="disabled" /> </s:states> <!-- host component --> <fx:Metadata> <![CDATA[ [HostComponent("spark.components.DropDownList")] ]]> </fx:Metadata> <!--- The PopUpAnchor control that opens the drop-down list. --> <s:PopUpAnchor id="popUp" displayPopUp.normal="false" displayPopUp.open="true" includeIn="open" left="0" right="0" top="0" bottom="0" itemDestructionPolicy="auto" popUpPosition="left" popUpWidthMatchesAnchorWidth="true"> <!--- The drop down area of the skin. This includes borders, background colors, scrollers, and filters. --> <s:Group id="dropDown" maxHeight="134" minHeight="22" > <!-- drop shadow --> <s:RectangularDropShadow blurX="20" blurY="20" alpha="1.0" distance="5" angle="90" color="#000000" left="0" top="0" right="0" bottom="0"/> <!-- border --> <s:Rect left="0" right="0" top="0" bottom="0"> <s:stroke> <s:SolidColorStroke color="0x686868" weight="1"/> </s:stroke> </s:Rect> <!-- fill --> <!--- Defines the appearance of drop-down list's background fill. --> <s:Rect id="background" left="1" right="1" top="1" bottom="1" > <s:fill> <!--- The color of the drop down's background fill. The default color is 0xFFFFFF. --> <s:SolidColor id="bgFill" color="0xFFFFFF" /> </s:fill> </s:Rect> <s:Scroller left="0" top="0" right="0" bottom="0" focusEnabled="false" minViewportInset="1"> <!--- The container for the data items in the drop-down list. --> <s:DataGroup id="dataGroup" itemRenderer="spark.skins.spark.DefaultItemRenderer"> <s:layout> <s:VerticalLayout gap="0" horizontalAlign="contentJustify"/> </s:layout> </s:DataGroup> </s:Scroller> </s:Group> </s:PopUpAnchor> <!--- The anchor button used by the DropDownList. The default skin is DropDownListButtonSkin. --> <s:Button id="openButton" left="0" right="0" top="0" bottom="0" focusEnabled="false" skinClass="spark.skins.spark.DropDownListButtonSkin" /> <!--- The prompt area of the DropDownList. --> <!-- <s:SimpleText id="labelDisplay" verticalAlign="middle" maxDisplayedLines="1" left="7" right="30" top="2" bottom="2" verticalCenter="1" /> --><!--- @copy spark.components.DropDownList#labelDisplay --><s:Label id="labelDisplay" verticalAlign="middle" maxDisplayedLines="1" mouseEnabled="false" mouseChildren="false" left="7" right="30" top="2" bottom="2" width="75" verticalCenter="1" /> </s:Skin>
ApplicationSkin.mxml:
<?xml version="1.0" encoding="utf-8"?><s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:mx="library://ns.adobe.com/flex/mx" xmlns:s="library://ns.adobe.com/flex/spark"xmlns:c="com.sununion.web.seller.component.*"><fx:Metadata>[HostComponent("spark.components.Application")]</fx:Metadata> <s:states><s:State name="normal" /><s:State name="disabled" /></s:states><!--背景--><!--<c:BackgroundComponent id="backgroundRect" left="0" right="0" top="0" bottom="0" />--><!--滚动条--><s:Scroller height="100%" width="100%" horizontalScrollPolicy="auto" verticalScrollPolicy="auto"><s:Group id="contentGroup" left="0" right="0" top="0" bottom="0" /> </s:Scroller></s:Skin>
效果图如下:
- [组件开发] flex 4 s:dropdownlist 垂直下拉滚动条 样式重写
- Flex 滚动条样式
- FLEX滚动条样式
- flex s:Scroller纵向滚动条 增加sparkSkin,添加到css样式表
- Flex 界面滚动条样式的设置
- 更改Flex tree 滚动条样式
- 自定义FLEX的滚动条样式
- Flex: DataGroup 组件增加滚动条
- 【code】flex给组件添加滚动条
- ScrollBar 垂直和水平滚动条的样式
- 垂直水平滚动条
- LinearLayout 垂直滚动条
- LinearLayout 垂直滚动条
- Android 垂直滚动条
- 垂直滚动条测试
- LinearLayout 垂直滚动条
- 模拟垂直滚动条
- 自定义垂直滚动条
- hadoop在ubuntu下的安装配
- 网页制作中控制表格边框的显示
- linux网络协议栈分析笔记10-arp邻居子系统3
- 连接
- 第一周项目2—日期结构体
- [组件开发] flex 4 s:dropdownlist 垂直下拉滚动条 样式重写
- C#中关于日期的函数
- 我的 云寻觅 搜索引擎 开始公测,前天开始开发,昨天买域名,今天发布在本机,请各路专家指正!
- Linux下两种TCP网络服务器实现方式:循环服务&并发服务
- HDU2527--Safe Or Unsafe
- Excel-REPT重复处理字符
- 百度笔试题合并a[0..mid]和a[mid+1,n-1],其中这两个数组分别有序
- android知识体系总结
- hibernate中如何取得孙子的个数size