博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
UITableViewDataSource Protocol Reference
阅读量:4519 次
发布时间:2019-06-08

本文共 1691 字,大约阅读时间需要 5 分钟。

Configuring a Table View //配置表格

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath //给予数据源指定indexPath位置的Cell元素(required method)- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView //给予数据源整个table包含的section数,默认为1- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section //给予数据源指定section所包含的Cell数(required method)- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView //给予数据源section的标题列表,与右侧的索引栏有关- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index //给予数据源真实的section与索引列表之间的关系,可以决定哪些section被索引栏引用- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section //给予数据源section的标题,nil为无标题- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section //给予数据源section的尾部标题,nil为无标题

 

Inserting or Deleting Table Rows //插入或删除列

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath //当用户操作tableCell默认的添加或删除按钮时会触发该委托,editingStyle是个枚举,包含UITableViewCellEditingStyleInsert和UITableViewCellEditingStyleDelete- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath //告诉数据源该cell能否启用编辑模式,YES是

Reordering Table Rows //重排表格列

- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath //告诉数据源该cell能否启用重排模式,YES是- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath //告诉数据源指定row移动到什么位置

 

 

转载于:https://www.cnblogs.com/cat3/archive/2013/04/01/2993746.html

你可能感兴趣的文章
Yarn源码分析1(Hadoop2.7.2)
查看>>
2018.1.24 计算机二级错题(1.24)
查看>>
【C#进阶】我与接口二三事:扩展方法
查看>>
Cocoa编程开发者手册
查看>>
C++框架_之Qt的开始部分_概述_安装_创建项目_快捷键等一系列注意细节
查看>>
html5基础学习
查看>>
理工之 A+B Problem III
查看>>
SalesForce自定义按钮(javascript执行),点击按钮更新Filed
查看>>
Android中ViewPager实现滑动条及与Fragment结合的实例教程
查看>>
组织过程资产与事业环境因素
查看>>
学习和思考的要点
查看>>
16年收官之战,堪称完美,祝愿大家2017一举成名天下闻,虎啸龙吟展宏图
查看>>
使用jquery获取ul的li的值赋值
查看>>
Struts 2 标签
查看>>
关于 BFC 的一些实践例子
查看>>
201671010129 2016—2017—2 《Java程序设计》学习Java总结
查看>>
[每日一讲] Python系列:变量、内存管理与传递
查看>>
UI设计黄金法则
查看>>
HTML页面的重绘(repaint)和重流(reflow)
查看>>
将联系人导入到iPhone模拟器
查看>>