UITableView使用详解
来源:互联网 发布:怎么下载ubuntu镜像 编辑:程序博客网 时间:2024/05/12 04:43
在开发iphone的应用时基本上都要用到UITableView,这里讲解一下UITableView的使用方法及代理的调用情况
- (void)viewDidLoad
{
}
//指定有多少个分区(Section),默认为1
- (NSInteger)numberOfSectionsInTableV
}
//每个section底部标题高度(实现这个代理方法后前面sectionHeaderHeight设定的高度无效)
-(CGFloat)tableView:(UITableView *)tableViewheightForHeaderInSection
}
//每个section头部标题高度(实现这个代理方法后前面sectionFooterHeight设定的高度无效)
-(CGFloat)tableView:(UITableView *)tableViewheightForFooterInSection
}
//每个section头部的标题-Header
- (NSString *)tableView:(UITableView *)tableViewtitleForHeaderInSection:(NSInteger)section{
}
//每个section底部的标题-Footer
- (NSString *)tableView:(UITableView *)tableViewtitleForFooterInSection:(NSInteger)section{
}
//用以定制自定义的section头部视图-Header
-(UIView *)tableView:(UITableView *)tableViewviewForHeaderInSection:(NSInteger)section{
}
//用以定制自定义的section底部视图-Footer
-(UIView *)tableView:(UITableView *)tableViewviewForFooterInSection:(NSInteger)section{
}
//指定每个分区中有多少行,默认为1
- (NSInteger)tableView:(UITableView *)tableViewnumberOfRowsInSection:(NSInteger)section{
}
//改变行的高度(实现主个代理方法后rowHeight设定的高度无效)
- (CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath{
}
//绘制Cell
-(UITableViewCell *)tableView:(UITableView *)tableViewcellForRowAtIndexPath:(NSIndexPath *)indexPath {
//
//
//
//
//
//
//
//
//
//
//
//
//
}
//行缩进
-(NSInteger)tableView:(UITableView *)tableViewindentationLevelForRowAt
}
//选中Cell响应事件
- (void)tableView:(UITableView *)tableViewdidSelectRowAtIndexPath:(NSIndexPath *)indexPath{
}
//行将显示的时候调用,预加载行
-(void)tableView:(UITableView *)tableViewwillDisplayCell:(UITableViewCell *)cellforRowAtIndexPath:(NSIndexPath*)indexPath
{
}
//选中之前执行,判断选中的行(阻止选中第一行)
-(NSIndexPath *)tableView:(UITableView *)tableViewwillSelectRowAtIndexPath
{
}
//编辑状态,点击删除时调用
- (void)tableView:(UITableView *)tableViewcommitEditingStyle:(UITableViewCellEditingSt
forRowAtIndexPath:(NSIndexPath *)indexPath
{
}
//cell右边按钮格式为UITableViewCellAccessory
-(void)tableView:(UITableView *)tableViewaccessoryButtonTappedFor
}
//右侧添加一个索引表
- (NSArray*)sectionIndexTitlesForTab
}
//划动cell是否出现del按钮
- (BOOL)tableView:(UITableView *)tableViewcanEditRowAtIndexPath:(NSIndexPath *)indexPath {
}
//设定横向滑动时是否出现删除按扭,(阻止第一行出现)
-(UITableViewCellEditingSt
{
}
//自定义划动时delete按钮内容
- (NSString *)tableView:(UITableView *)tableView
titleForDeleteConfirmati
}
//开始移动row时执行
-(void)tableView:(UITableView *)tableViewmoveRowAtIndexPath:(NSIndexPath*)sourceIndexPath toIndexPath:(NSIndexPath*)destinationIndexPath
{
}
//滑动可以编辑时执行
-(void)tableView:(UITableView *)tableViewwillBeginEditingRowAtInd
{
}
//将取消选中时执行,也就是上次先中的行
-(NSIndexPath *)tableView:(UITableView *)tableViewwillDeselectRowAtIndexPa
{
}
//让行可以移动
-(BOOL)tableView:(UITableView *)tableViewcanMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
}
//移动row时执行
-(NSIndexPath *)tableView:(UITableView *)tableViewtargetIndexPathForMoveFr
{
}
转至:http://blog.sina.com.cn/s/blog_9693f61a01016lv5.html
- UITableView使用详解
- UITableView使用详解
- UITableView使用详解
- UITableView的使用详解
- UITableView 使用详解 教程
- UITableView使用详解
- (转)UITableView使用详解
- UITableView使用详解
- iOS UITableView使用详解
- UITableView使用详解
- UITableView的使用详解
- UITableView使用详解
- UITableView使用详解
- UITableView的使用与详解
- iOS-UITableView使用详解深入浅出
- UITableView(表视图)使用详解
- UITableView使用详解 相当详细
- iOS 之 UITableView 使用详解
- 保存几篇文章,以后有空时再看!
- placeholde 兼容问题
- 解决IllegalStateException: Can not perform this action after onSaveInstanceState
- nodejs(npm)——创建全局链接
- 分页
- UITableView使用详解
- Android ListView 分类显示(二)多布局显示
- 排列组合算法之二: 01转换法_java改变后的c++改进版
- 面试笔记整理
- AJAX jsonp 跨域请求code
- [倚天屠龙记] vim 查找与替换(简单查找)
- repeater分页的实现
- socket错误
- perl常用命令