Class ccui.ListView
- Defined in: UIListView.js
- Extends ccui.ScrollView
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Base class for ccui.ListView
|
Method Summary
Class Detail
ccui.ListView()
Base class for ccui.ListView
Method Detail
-
addChild(widget, zOrder, tag)add child to ListView
- Parameters:
- {cc.Node} widget
- {Number} zOrder Optional
- {Number|String} tag Optional
- tag or name
-
addEventListenerListView(selector, target)add event listener
- Parameters:
- {Function} selector
- {Object} target
-
<static> ccui.ListView.create()allocates and initializes a UIListView.
// example var uiPageView = ccui.ListView.create();
-
ctor()allocates and initializes a UIListView. Constructor of ccui.ListView
// example var uiPageView = new ccui.ListView();
-
doLayout()public the _doLayout for Editor
-
{number} getCurSelectedIndex()get current selected index
- Returns:
- {number}
-
{string} getDescription()Returns the "class name" of widget.
- Returns:
- {string}
-
{Number} getIndex(item)Returns the index of item.
- Parameters:
- {ccui.Widget} item
- the item which need to be checked.
- Returns:
- {Number} the index of item.
-
{ccui.Widget} getItem(index)Returns a item whose index is same as the parameter.
- Parameters:
- {Number} index
- Returns:
- {ccui.Widget}
-
{Array} getItems()Returns the item container.
- Returns:
- {Array}
-
{Number} getItemsMargin()Get the margin between each item.
- Returns:
- {Number}
-
insertCustomItem(item, index)Push back custom item into ListView.
- Parameters:
- {ccui.Widget} item
- {Number} index
-
insertDefaultItem(index)Insert a default item(create by a cloned model) into ListView.
- Parameters:
- {Number} index
-
pushBackCustomItem(item)Push back custom item into ListView.
- Parameters:
- {ccui.Widget} item
-
pushBackDefaultItem()Push back a default item(create by a cloned model) into ListView.
-
removeChild(widget, cleanup)remove child from ListView
- Parameters:
- {cc.Node} widget
- {Boolean} cleanup Optional, Default: true
-
removeItem(index)Removes a item whose index is same as the parameter.
- Parameters:
- {Number} index
-
removeLastItem()Removes the last item of ListView.
-
requestRefreshView()request refresh view
-
setDirection(dir)Changes scroll direction of scrollview.
- Parameters:
- {ccui.ScrollView.DIR_NONE | ccui.ScrollView.DIR_VERTICAL | ccui.ScrollView.DIR_HORIZONTAL | ccui.ScrollView.DIR_BOTH} dir
-
setGravity(gravity)Changes the gravity of ListView.
- Parameters:
- {ccui.ListView.GRAVITY_LEFT|ccui.ListView.GRAVITY_RIGHT|ccui.ListView.GRAVITY_CENTER_HORIZONTAL|ccui.ListView.GRAVITY_BOTTOM|ccui.ListView.GRAVITY_CENTER_VERTICAL} gravity
-
setItemModel(model)Sets a item model for ListView. A model will be cloned for adding default item.
- Parameters:
- {ccui.Widget} model
-
setItemsMargin(margin)Changes the margin between each item.
- Parameters:
- {Number} margin