iOS 之 UITableView 使用详解
来源:互联网 发布:淘宝联盟可以相信吗 编辑:程序博客网 时间:2024/05/18 16:15
在开发iphone的应用时基本上都要用到UITableView,这里讲解一下UITableView的使用方法及代理的调用情况
- (void)viewDidLoad
{
myTableView_.separatorStyle = UITableViewCellSeparatorStyleNone; // 隐藏分割线
}
//指定有多少个分区(Section),默认为1
- (NSInteger)numberOfSectionsInTableV
}
//每个section底部标题高度(实现这个代理方法后前面 sectionHeaderHeight 设定的高度无效)
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection
}
//每个section头部标题高度(实现这个代理方法后前面 sectionFooterHeight 设定的高度无效)
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection
}
//每个section头部的标题-Header
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
}
//每个section底部的标题-Footer
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section{
}
//用以定制自定义的section头部视图-Header
-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
}
//用以定制自定义的section底部视图-Footer
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
}
//指定每个分区中有多少行,默认为1
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
}
//改变行的高度(实现主个代理方法后 rowHeight 设定的高度无效)
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
}
//绘制Cell
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//
//
//
//
//
//
//
//
//
//
//
//
}
//行缩进
-(NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAt
}
//选中Cell响应事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath{
}
//行将显示的时候调用,预加载行
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
}
//选中之前执行,判断选中的行(阻止选中第一行)
-(NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath
{
}
//编辑状态,点击删除时调用
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingSt
forRowAtIndexPath:(NSIndexPath *)indexPath
{
}
//cell右边按钮格式为UITableViewCellAccessory
-(void)tableView:(UITableView *)tableView accessoryButtonTappedFor
}
//右侧添加一个索引表
- (NSArray *)sectionIndexTitlesForTab
}
//划动cell是否出现del按钮
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath*)indexPath {
}
//设定横向滑动时是否出现删除按扭,(阻止第一行出现)
-(UITableViewCellEditingSt
{
}
//自定义划动时delete按钮内容
- (NSString *)tableView:(UITableView *)tableView
titleForDeleteConfirmati
}
//开始移动row时执行
-(void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath*)sourceIndexPath toIndexPath:(NSIndexPath*)destinationIndexPath
{
}
//滑动可以编辑时执行
-(void)tableView:(UITableView *)tableView willBeginEditingRowAtInd
{
}
//将取消选中时执行, 也就是上次先中的行
-(NSIndexPath *)tableView:(UITableView *)tableView willDeselectRowAtIndexPa
{
}
//让行可以移动
-(BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath*)indexPath
{
}
//移动row时执行
-(NSIndexPath *)tableView:(UITableView *)tableView targetIndexPathForMoveFr
{
}
- iOS 之 UITableView 使用详解
- iOS UITableView使用详解
- IOS之UITableView使用
- IOS控件之UITableView详解
- iOS开发之UITableView详解
- iOS-UITableView使用详解深入浅出
- iOS 之 UITableView 使用详解/性能优化/UITableViewCell/UITableViewController
- iOS之UITableView的使用
- iOS 之 UITableView 使用索引
- 芒果iOS开发之UITableView详解
- iOS学习之——UITableView详解
- iOS中表视图(UITableView)使用详解
- iOS开发笔记之UITableView的使用
- iOS开发之UITableView的使用
- IOS控件之UITableView使用技巧
- IOS控件UITableView详解
- IOS控件UITableView详解
- IOS控件UITableView详解
- MySQL 出现“2003-Can't connection to MySQL server on 'localhost' (10061)”解决方案
- CRM系统Salesforce 客户bill触发器
- 如何解决Tomcat端口被占用问题
- 清华TUNA镜像源下载Android源码的方法
- Android开发快捷键
- iOS 之 UITableView 使用详解
- POJ 1077八数码问题(cantor展开+BFS)
- Ajax核心知识——XMLHttpRequest
- recycleview中item的刷新方法
- LinkedList与ArrayList的区别
- JVM 字节码执行实例分析
- HDU 2001 计算两点间的距离(水题)
- poj 3321 Apple Tree(dfs序+线段树)
- 打开MySQL的慢查询记录