复制代码
1
2
3
4
5
6
7
8
9
10
11var tableView = new cc.TableView(this, cc.size(tableViewSize.width, tableViewSize.height)); tableView.setDirection(cc.SCROLLVIEW_DIRECTION_VERTICAL); tableView.setPosition(tableViewPosition); tableView.setAnchorPoint(tableViewAnchor); tableView.setDelegate(this); this.addChild(tableView); tableView.retain(); //引用计数+1 tableView.reloadData(); this._tableView = tableView;
复制代码
1
2
3
4
5onExit: function () { if (this._tableView) this._tableView.release(); cc.Layer.prototype.onExit.call(this); },
复制代码
1tableCellTouched: function (table, cell){
复制代码
1
2
3
4
5
6复制代码} //点击相应的Item去处理相应的操作tableCellAtIndex: function (table, idx) {} //创建具体的Item中的地方var idx = cell.getIdx();
复制代码复制代码numberOfCellsInTableView: function (table) { return data['arr'].length; }
复制代码tableCellSizeForIndex: function (table, idx) { return cellSize; }, //每一个Item尺寸
复制代码scrollViewDidScroll: function (view) { }, scrollViewDidZoom: function (view) { },
复制代码
最后
以上就是温婉纸鹤最近收集整理的关于table View的全部内容,更多相关table内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复