课程表

入门与环境搭建

简单控件的使用

视图控制

调用、存储、网络和动画

其他控件的使用

工具箱
速查手册

CATableViewDataSource

当前位置:免费教程 » 移动开发 » CrossApp

类说明

CATableView的数据代理类,用于定义tableView的数据接口。


CATableViewDataSource 方法(点击查看方法介绍)

方法说明
tableCellAtIndex获取指定cell
tableViewHeightForRowAtIndexPath获取指定的cell高度
numberOfRowsInSection获取对应的section所包含的cell个数
numberOfSections获取tableview包含的section个数
tableViewSectionViewForHeaderInSection在tableView中通过索引获取头部Section
tableViewHeightForHeaderInSection在tableView中通过索引获取头部Section高度
tableViewSectionViewForFooterInSection在tableView中通过索引获取尾部Section
tableViewHeightForFooterInSection在tableView中通过索引获取尾部Section高度
tableViewWillDisplayCellAtIndex回调当前将要显示的tableView


CATableViewDataSource 方法说明

virtual CATableViewCell* tableCellAtIndex(CATableView* table, const DSize& cellSize, unsigned int section, unsigned int row) = 0;

返回值:CATableViewCell* 

参数:

类型参数名说明
CATableView*table当前tableView
const DSize&cellSizecell的size
unsigned intsectioncell所属的区域
unsigned introwcell所在行数

解释:获取指定cell


virtual unsigned int tableViewHeightForRowAtIndexPath(CATableView* table, unsigned int section, unsigned int row) = 0;

返回值:unsigned int

参数:

类型参数名说明
CATableView*table当前tableView
unsigned intsectioncell所属的区域
unsigned introwcell所在行数

解释:获取指定的cell高度


virtual unsigned int numberOfRowsInSection(CATableView* table, unsigned int section) = 0;

返回值:unsigned int

参数:

类型参数名说明
CATableView*table当前tableView
unsigned intsectioncell所属的区域

解释:获取对应的section所包含的cell个数


virtual unsigned int numberOfSections(CATableView* table);

返回值:unsigned int

参数:

类型参数名说明
CATableView*table当前tableView

解释:获取tableview包含的section个数


virtual CAView* tableViewSectionViewForHeaderInSection(CATableView* table, const DSize& viewSize, unsigned int section);

返回值:CAView*

参数:

类型参数名说明
CATableView*table当前tableView
const DSize&viewSizeview的size
unsigned intsectioncell所属的区域

解释:在tableView中通过索引获取头部Section


virtual unsigned int tableViewHeightForHeaderInSection(CATableView* table, unsigned int section);

返回值:unsigned int

参数:

类型参数名说明
CATableView*table当前tableView
const DSize&cellSizecell的size

解释:在tableView中通过索引获取头部Section高度


virtual CAView* tableViewSectionViewForFooterInSection(CATableView* table, const DSize& viewSize, unsigned int section);

返回值:CAView*

参数:

类型参数名说明
CATableView*table当前tableView
const DSize&viewSizeview的size
unsigned intsectioncell所属的区域

解释:在tableView中通过索引获取尾部Section


virtual unsigned int tableViewHeightForFooterInSection(CATableView* table, unsigned int section);

返回值:unsigned int

参数:

类型参数名说明
CATableView*table当前tableView
unsigned intsectioncell所属的区域

解释:在tableView中通过索引获取尾部Section高度


virtual void tableViewWillDisplayCellAtIndex(CATableView* table, CATableViewCell* cell, unsigned int section, unsigned int row) {};

返回值:void

参数:

类型参数名说明
CATableView*table当前tableView
CATableViewCell*cellcell
unsigned intsectioncell所属的区域
unsigned introwcell所在行数

解释:回调当前将要显示的tableView

转载本站内容时,请务必注明来自W3xue,违者必究。
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号