UITableView使用详解
来源:互联网 发布:java 从url去掉ip地址 编辑:程序博客网 时间:2024/05/23 15:06
在开发iphone的应用时基本上都要用到UITableView,这里讲解一下UITableView的使用方法及代理的调用情况
- (void)viewDidLoad
{
}
//指定有多少个分区(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
{
}
- UITableView使用详解
- UITableView使用详解
- UITableView使用详解
- UITableView的使用详解
- UITableView 使用详解 教程
- UITableView使用详解
- (转)UITableView使用详解
- UITableView使用详解
- iOS UITableView使用详解
- UITableView使用详解
- UITableView的使用详解
- UITableView使用详解
- UITableView使用详解
- UITableView的使用与详解
- iOS-UITableView使用详解深入浅出
- UITableView(表视图)使用详解
- UITableView使用详解 相当详细
- iOS 之 UITableView 使用详解
- JavaSE 最容易出错的几个简单的问题
- VC++弹出U盘
- windows下oracle自动备份
- 【bzoj1059】 ZJOI2007矩阵游戏 二分图匹配
- 内核启动logo
- UITableView使用详解
- 嵌套的多个hover事件处理
- Android 通过inputstream 加载非Drawable 文件夹下的 .9 path 图片
- 软件系统上线前演示剧本
- apt-get fix: remove all packet
- 视音频技术零基础学习笔记(三)及解码程序添加注释
- oracle中 connect by prior 递归算法
- hdu 1268 积木堆砌的城堡(贪心)
- 常见26个jquery使用技巧详解(比如禁止右键点击、隐藏文本框文字等)