CATableViewDataSource

类说明

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


作者:terry,如若转载,请注明出处:https://www.web176.com/crossapp/10202.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2023年2月21日
下一篇 2023年2月21日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注