UITableView 常用方法列表

  • Delegate:

  • |--UITableViewDelegate
  • ||----tableView: didSelectRowAtIndexPath:  //点击某个cell执行的方法
  • ||----tableView:heightForFooterInSection:    //设置自定义未标题的高度
  • ||----tableView: heightForHeaderInSection: //设置某个cell的高度
  • ||----tableView: viewForHeaderInSection:    //设置自定义头视图
  • ||----tableView: viewForFooterLnSection:     //设置自定义尾视图
  • ||----tableView: willBeginEditingRowAtIndexPath:  //将要开始编辑
  • ||----tableView: willDisplayCell: forRowAtIndexPath:   //将要显示某个cell
  • ||----tableView: willSelectRowAtIndexPath:   //将要选中某个cell
  • ||----tableView:titleForDeleteConfirmationButtonForRowAtIndexPath:   //设置动删除时删除按钮上的文字
  • |--UITableViewDataSource
  • ||----numberOfSectionInTableView://设置共有多少个分组
  • ||----tableView: numberOfRowsInSection://设置某个分组中有多少行
  • ||----tableView: cellForRowAtIndexPath://设置某行上显示什么内容
  • ||----tableView: titleForHeaderInSection://设置分区的头标题 (NSString *)
  • ||----tableView: titleForFooterInSection://设置分区的尾标题 (NSString *)
  • ||----sectionIndexTitlesForTableView://设置快速索引栏的内容 (NSArray *)
  • ||----tableView: canEditRowAtIndexPath://设置是否可以编辑
  • ||----tableView:canMoveRowAtIndexPath://设置是否可以移动
  • ||----tableView: commitEditingStyle:forRowAtIndexPath://处理编辑状态下的情况
  • ||----tableView: moveRowAtIndexPath:toIndexPath://移动过程中执行的方法

  • Methods:

  • ||----initWithFrame: style://初始化方法,设置frame和样式
  • ||----insertRowsAtIndexPaths:withRowAnimation: //插入行,在指定位置,使用动画
  • ||----deleteRowsAtIndexPaths: withRowAnimation://删除行,在指定位置,使用动画
  • ||----moveRowAtIndexPath: toIndexPath://移动一行,从一个位置,到另一个位置
  • ||----insertSection: withRowAnimation: //插入分组,使用动画
  • ||----deleteSection:withRowAnimation: //删除分组,使用动画
  • ||----moveSection: toSection: //移动分组,从一个位置,到另一个位置
  • ||----setEditing: animated://进入编辑状态,使用动画
  • ||----reloadData//更新所有数据
  • ||----reloadRowsAtIndexPaths: WithRowAnimation://更新某几行数据,使用动画

  • Properties:
  • ||----tableHeaderView//自定义头视图
  • ||----tableFooterView//自定义尾视图
  • ||----separatorStyle//cell之间分割线样式
  • ||----separatorColor//cell之间分割线颜色
  • ||----sectionHeaderHeight//头标题高度
  • ||----sectionFooterHeight//尾标题高度
  • ||----rowHeight//行高
  • ||----editing//是否正在编辑
  • ||----dataSource//数据源代理
  • ||----backgroundView//背景视图,(UIView *)
  • ||----allowsMultipleSelectionDuringEditing//是否允许在编辑状态下多选
  • ||----allowsMultipleSelection//是否允许多选
  • ||----allowsSelectionDuringEditing//是否允许在编辑状态下选中
  • ||----allowsSelection//是否允许选中
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值