W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
類說明
CATableView的數(shù)據(jù)代理類,用于定義tableView的數(shù)據(jù)接口。
CATableViewDataSource 方法(點(diǎn)擊查看方法介紹)
方法 | 說明 |
tableCellAtIndex | 獲取指定cell |
tableViewHeightForRowAtIndexPath | 獲取指定的cell高度 |
numberOfRowsInSection | 獲取對(duì)應(yīng)的section所包含的cell個(gè)數(shù) |
numberOfSections | 獲取tableview包含的section個(gè)數(shù) |
tableViewSectionViewForHeaderInSection | 在tableView中通過索引獲取頭部Section |
tableViewHeightForHeaderInSection | 在tableView中通過索引獲取頭部Section高度 |
tableViewSectionViewForFooterInSection | 在tableView中通過索引獲取尾部Section |
tableViewHeightForFooterInSection | 在tableView中通過索引獲取尾部Section高度 |
tableViewWillDisplayCellAtIndex | 回調(diào)當(dāng)前將要顯示的tableView |
CATableViewDataSource 方法說明
virtual CATableViewCell* tableCellAtIndex(CATableView* table, const DSize& cellSize, unsigned int section, unsigned int row) = 0;
返回值:CATableViewCell*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
const DSize& | cellSize | cell的size |
unsigned int | section | cell所屬的區(qū)域 |
unsigned int | row | cell所在行數(shù) |
解釋:獲取指定cell
virtual unsigned int tableViewHeightForRowAtIndexPath(CATableView* table, unsigned int section, unsigned int row) = 0;
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
unsigned int | section | cell所屬的區(qū)域 |
unsigned int | row | cell所在行數(shù) |
解釋:獲取指定的cell高度
virtual unsigned int numberOfRowsInSection(CATableView* table, unsigned int section) = 0;
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
unsigned int | section | cell所屬的區(qū)域 |
解釋:獲取對(duì)應(yīng)的section所包含的cell個(gè)數(shù)
virtual unsigned int numberOfSections(CATableView* table);
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
解釋:獲取tableview包含的section個(gè)數(shù)
virtual CAView* tableViewSectionViewForHeaderInSection(CATableView* table, const DSize& viewSize, unsigned int section);
返回值:CAView*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
const DSize& | viewSize | view的size |
unsigned int | section | cell所屬的區(qū)域 |
解釋:在tableView中通過索引獲取頭部Section
virtual unsigned int tableViewHeightForHeaderInSection(CATableView* table, unsigned int section);
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
const DSize& | cellSize | cell的size |
解釋:在tableView中通過索引獲取頭部Section高度
virtual CAView* tableViewSectionViewForFooterInSection(CATableView* table, const DSize& viewSize, unsigned int section);
返回值:CAView*
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
const DSize& | viewSize | view的size |
unsigned int | section | cell所屬的區(qū)域 |
解釋:在tableView中通過索引獲取尾部Section
virtual unsigned int tableViewHeightForFooterInSection(CATableView* table, unsigned int section);
返回值:unsigned int
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
unsigned int | section | cell所屬的區(qū)域 |
解釋:在tableView中通過索引獲取尾部Section高度
virtual void tableViewWillDisplayCellAtIndex(CATableView* table, CATableViewCell* cell, unsigned int section, unsigned int row) {};
返回值:void
參數(shù):
類型 | 參數(shù)名 | 說明 |
CATableView* | table | 當(dāng)前tableView |
CATableViewCell* | cell | cell |
unsigned int | section | cell所屬的區(qū)域 |
unsigned int | row | cell所在行數(shù) |
解釋:回調(diào)當(dāng)前將要顯示的tableView
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: