您的位置:首页 > Web前端

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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息