Starling Feathers Controls GroupedList
来源:互联网 发布:Ubuntu安装VNC 编辑:程序博客网 时间:2024/05/22 05:05
说明:
The GroupedList
class renders groups of items from a hierarchical data source. It includes support for selection, scrolling, custom layouts, layout virtualization, and custom item renderers, similar to the List
component.
用法:
因为用到了图标,所以需要下面的代码载入材质
private function loadTextures():void{var appDir:File = File.applicationDirectory;textureAtlas = new AssetManager();textureAtlas.verbose = Capabilities.isDebugger;textureAtlas.enqueue(appDir.resolvePath("textures/"));textureAtlas.loadQueue(assetOnProgress);System.pauseForGCIfCollectionImminent(0);System.gc();}private function assetOnProgress(ratio:Number):void{trace("ratio:",ratio);if (ratio == 1) Starling.juggler.delayCall(initialize, 0.15);}
下面是使用GroupedList的代码
private function testGroupedList():void{var list:GroupedList = new GroupedList();list.dataProvider = new HierarchicalCollection([{header: "Dairy",children:[{ text: "Milk", thumbnail: textureAtlas.getTexture( "milk0000" ) },{ text: "Cheese", thumbnail: textureAtlas.getTexture( "cheese0000" ) },]},{header: "Bakery",children:[{ text: "Bread", thumbnail: textureAtlas.getTexture( "bread0000" ) },]},{header: "Produce",children:[{ text: "Bananas", thumbnail: textureAtlas.getTexture( "bananas0000" ) },{ text: "Lettuce", thumbnail: textureAtlas.getTexture( "lettuce0000" ) },{ text: "Onion", thumbnail: textureAtlas.getTexture( "onion0000" ) },]},]);list.itemRendererFactory = function():IGroupedListItemRenderer{var renderer:DefaultGroupedListItemRenderer = new DefaultGroupedListItemRenderer();renderer.labelField = "text";renderer.iconSourceField = "thumbnail";return renderer;};list.addEventListener( Event.CHANGE, list_changeHandler );this.addChild( list );}
效果:
更多说明参考:
0 0
- Starling Feathers Controls GroupedList
- Starling Feathers Controls Alert
- Starling Feathers Controls Button
- Starling Feathers Controls ButtonGroup
- Starling Feathers Controls Callout
- Starling Feathers Controls Check
- Starling Feathers Controls Drawers
- Starling Feathers Controls Header
- Starling Feathers Controls ImageLoader
- Starling Feathers Controls Label
- Starling Feathers Controls LayoutGroup
- Starling Feathers Controls List
- Starling Feathers Controls NumericStepper
- Starling Feathers Controls PageIndicator
- Starling Feathers Controls Panel
- Starling Feathers Controls PanelScreen
- Starling Feathers Controls PickerList
- Starling Feathers Controls ProgressBar
- curl进行文件上传的一个demo
- Qt5与QML(一)
- Binary Tree Postorder Traversal
- 黑马程序员———java 类加载器
- 字符集和编码格式
- Starling Feathers Controls GroupedList
- 循环-25. 求给定序列前N项和之三(15)
- iOS-实现文件上传下载
- 正则表达式 学习
- 错误契约[FaultContract]
- OC 内存管理
- unity 基础之文件资源管理
- SurfaceView+SurfaceHolder+Thread完成游戏开发
- tomcat7.0用户名和密码配置