iOS之UITableView
2015-09-24 14:16
447 查看
UITableViewDelegate协议方法
返回每一行单元格的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
返回分区区头的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
返回分区区角的高度
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
返回分区区头的自定义View(可以使用重用机制)
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
返回分区区脚的自定义View(可以使用重用机制)
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
单元格右侧附件按钮点击时执行的方法
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
将要选中单元格的时候执行的方法
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
不选中单元格执行的方法
- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath
选中单元格时候执行的方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
取消选中单元格时候执行的方法
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
设置每一个单元格的编辑风格
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewCellEditingStyleNone,
UITableViewCellEditingStyleDelete,
UITableViewCellEditingStyleInsert
设置按钮的标题
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
设置单元格是否需要缩排
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
单元格即将编辑时执行的方法
- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
单元格完成编辑时候执行的方法
- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
单元格在移动过程中执行的方法
- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath
*)proposedDestinationIndexPath
是否显示菜单的复制粘贴
- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewDataSource协议方法
必须实现:
每个分区有多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
每个单元格的内容(单元格有重用机制,并且可以自定义)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
非必须实现:
有多少分区(默认为1)
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
分区区头标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
分区区脚标题
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
设置单元格是否可以编辑
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
设置单元格是否可以移动
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
设置表格右侧的索引数组
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
设置表格的索引和分区的对应关系
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
提交单元格编辑状态的时候执行的方法(即添加.删除按钮)
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath
*)indexPath
单元格移动的时候执行的方法(从初始位置到目标位置)
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath
*)destinationIndexPath
返回每一行单元格的高度
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
返回分区区头的高度
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
返回分区区角的高度
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
返回分区区头的自定义View(可以使用重用机制)
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
返回分区区脚的自定义View(可以使用重用机制)
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
单元格右侧附件按钮点击时执行的方法
- (void)tableView:(UITableView *)tableView accessoryButtonTappedForRowWithIndexPath:(NSIndexPath *)indexPath
将要选中单元格的时候执行的方法
- (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath
不选中单元格执行的方法
- (NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPath:(NSIndexPath *)indexPath
选中单元格时候执行的方法
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
取消选中单元格时候执行的方法
- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
设置每一个单元格的编辑风格
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewCellEditingStyleNone,
UITableViewCellEditingStyleDelete,
UITableViewCellEditingStyleInsert
设置按钮的标题
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath
设置单元格是否需要缩排
- (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
单元格即将编辑时执行的方法
- (void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath
单元格完成编辑时候执行的方法
- (void)tableView:(UITableView*)tableView didEndEditingRowAtIndexPath:(NSIndexPath *)indexPath
单元格在移动过程中执行的方法
- (NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFromRowAtIndexPath:(NSIndexPath *)sourceIndexPath toProposedIndexPath:(NSIndexPath
*)proposedDestinationIndexPath
是否显示菜单的复制粘贴
- (BOOL)tableView:(UITableView *)tableView shouldShowMenuForRowAtIndexPath:(NSIndexPath *)indexPath
UITableViewDataSource协议方法
必须实现:
每个分区有多少行
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
每个单元格的内容(单元格有重用机制,并且可以自定义)
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
非必须实现:
有多少分区(默认为1)
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
分区区头标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
分区区脚标题
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section
设置单元格是否可以编辑
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
设置单元格是否可以移动
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
设置表格右侧的索引数组
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
设置表格的索引和分区的对应关系
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
提交单元格编辑状态的时候执行的方法(即添加.删除按钮)
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath
*)indexPath
单元格移动的时候执行的方法(从初始位置到目标位置)
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath
*)destinationIndexPath
相关文章推荐
- setRequestedOrientation设置屏幕方向
- 如何使用xib自定义UITableViewCell
- Android UI设计
- 重写UITabBar 关键步骤小结
- 14-EMM Procedure 4. Service Request
- Android 异步查询框架AsyncQueryHandler的使用
- Number Sequence---hdu1711(kmp)
- UILabel UiButton 文字下面加下划线
- UILabel,UITextField 以及UIButton应用
- Liferay中request
- leetcode 95-96:Unique Binary Search Trees
- <s:checkbox> fieldValue取值问题
- Introduction to Java Programming编程题8.37<Guess the capitals>
- White spaces are required between publicId and systemId
- Jenkins-svn: E175002: OPTIONS request failed on URL
- easyui tabs中打开新的tabs关闭当前tabs
- easyUI之Form(表单)组件
- iOS开发UI篇—Quartz2D使用(图形上下文栈)
- GPUImage
- quicksort+binarySearch