UITabelViewDelegate方法的翻译

Configuring Rows for the Table View

1、- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath

返回所在cell的深度
2、- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
设置cell的高度
3、- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
表视图调用代理方法之前,用cell画出一个row,从而允许代理定制cell对象。这种方法使代理有机会重写基于状态的特性,如选择和背景颜色。这个代理方法返回后,表视图仅仅设置alpha和frame属性,然后,仅当移动行的时候发生变化,如滑入或滑出。

Managing Accessory Views


4、- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
cell右侧展示按钮被点击时的响应方法
5、- (UITableViewCellAccessoryType)tableView:(UITableView *)tableView accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath

返回类型选择按钮,在ios3以后已经废弃,使用cell.accessoryType代替

Managing Selections

6、- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath

Cell被选中响应前动作(例如:可用以判断选中的Cell,来阻止其响应)

7、- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath

选中cell时响应的动作

8、- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath

将取消选中时执行的动作

9、- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath

取消选中时执行的动作

Modifying the Header and Footer of Sections


10、- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

返回一个UIView对象,展示在section的页头

11、- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section

返回一个UIView对象,展示在尾部的页尾

12、- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section

返回section的页头高度

13、- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section

返回section的页尾高度

Editing Table Rows

在单元格上划动,会在划动的单元格右边显示“Delete”按钮, 这是SDK提供的快捷删除单元格的方法, 官方说法是

 swipe to delete

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle 

forRowAtIndexPath:(NSIndexPath *)indexPath

当点击“Delete” 删除按钮是会发送该消息, 在此可以处理删除。

14、- (void)tableView:(UITableView *)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath

删除按钮显示前执行

15、- (void)tableView:(UITableView *)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath

删除按钮完成后执行

16、- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath

设置单元格样式


有空再补充完整了,最近在杭州诸事不顺,没有心情弄这些了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值