Starling Feathers Controls PickerList
2014-09-12 14:42
351 查看
说明:
The PickerList class displays a Button that may be triggered to show a pop-up List. The way that the list is displayed may be customized for different platforms by changing the picker list's pop-up content manager. Several different options are available, including
drop downs, callouts, and simply filling the stage vertically.
示例:
var list:PickerList = new PickerList();
list.dataProvider = new ListCollection(
[
{ text: "Milk", thumbnail: textureAtlas.getTexture( "milk" ) },
{ text: "Eggs", thumbnail: textureAtlas.getTexture( "eggs" ) },
{ text: "Bread", thumbnail: textureAtlas.getTexture( "bread" ) },
{ text: "Chicken", thumbnail: textureAtlas.getTexture( "chicken" ) },
]);
list.listProperties.itemRendererFactory = function():IListItemRenderer
{
var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();
renderer.labelField = "text";
renderer.iconSourceField = "thumbnail";
return renderer;
};
list.addEventListener( Event.CHANGE, list_changeHandler );
this.addChild( list );
function list_changeHandler(e:Event):void
{
trace(list.selectedItem.text);
}
效果:
更多说明参考:
http://wiki.starling-framework.org/feathers/picker-list
The PickerList class displays a Button that may be triggered to show a pop-up List. The way that the list is displayed may be customized for different platforms by changing the picker list's pop-up content manager. Several different options are available, including
drop downs, callouts, and simply filling the stage vertically.
示例:
var list:PickerList = new PickerList();
list.dataProvider = new ListCollection(
[
{ text: "Milk", thumbnail: textureAtlas.getTexture( "milk" ) },
{ text: "Eggs", thumbnail: textureAtlas.getTexture( "eggs" ) },
{ text: "Bread", thumbnail: textureAtlas.getTexture( "bread" ) },
{ text: "Chicken", thumbnail: textureAtlas.getTexture( "chicken" ) },
]);
list.listProperties.itemRendererFactory = function():IListItemRenderer
{
var renderer:DefaultListItemRenderer = new DefaultListItemRenderer();
renderer.labelField = "text";
renderer.iconSourceField = "thumbnail";
return renderer;
};
list.addEventListener( Event.CHANGE, list_changeHandler );
this.addChild( list );
function list_changeHandler(e:Event):void
{
trace(list.selectedItem.text);
}
效果:
更多说明参考:
http://wiki.starling-framework.org/feathers/picker-list
相关文章推荐
- Starling Feathers Controls PickerList
- Starling Feathers Controls List
- Starling Feathers Controls List
- Starling Feathers Controls GroupedList
- Starling Feathers Controls GroupedList
- Starling Feathers Controls ImageLoader
- Starling Feathers Controls Alert
- Starling Feathers Controls ImageLoader
- Starling Feathers Controls PanelScreen
- Starling Feathers Controls Alert
- Starling Feathers Controls Check
- Starling Feathers Controls Label
- Starling Feathers Controls PanelScreen
- Starling Feathers Controls Check
- Starling Feathers Controls Label
- Starling Feathers Controls LayoutGroup
- Starling Feathers Controls ProgressBar
- Starling Feathers Controls LayoutGroup
- Starling Feathers Controls ProgressBar
- Starling Feathers Controls Radio