1 分区数
- (NSInteger)numberOfSectionsInTableView:(UITableView*)tableView
2 分区header/footer高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
3 分区row数
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
4 row的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath
5 cell的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
6 给cell赋值后再调用一次row的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath
7 分区header/footer的view
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
8 在调用分区header/footer的view的方法后,不在调用该方法
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section;
本文详细介绍了UITableView在iOS开发中使用的各种数据源方法,包括分区数量、分区头部和尾部的高度设置、每一分区的行数、行的高度、单元格内容配置等。通过这些方法,开发者可以更好地管理和定制UITableView的显示效果。
1万+

被折叠的 条评论
为什么被折叠?



