tableview的代理
来源:互联网 发布:p5.js正方形 编辑:程序博客网 时间:2024/05/16 23:59
设置关于tableview行:
–tableView:heightForRowAtIndexPath:
设置行高在这里边我们可以通过IndexPath判断是否点击 如果点击 我们kei改变行高
常用代码如下:
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row!=selectedRow)
return 72.0f;
else return 100f;
}
如果动态改变行高:那么就需要
–tableView:indentationLevelForRowAtIndexPath:
设置缩进
–tableView:willDisplayCell:forRowAtIndexPath:
@protocolUITableViewDelegate<NSObject,UIScrollViewDelegate>
@optional
// Displaycustomization
-(void)tableView:(UITableView *)tableViewwillDisplayCell:(UITableViewCell *)cellforRowAtIndexPath:(NSIndexPath *)indexPath;
//高的设置
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath;
-(CGFloat)tableView:(UITableView *)tableViewheightForHeaderInSection:(NSInteger)section;
-(CGFloat)tableView:(UITableView *)tableViewheightForFooterInSection:(NSInteger)section;
// Section header& footer视图设置
- (UIView*)tableView:(UITableView *)tableViewviewForHeaderInSection:(NSInteger)section;
- (UIView*)tableView:(UITableView *)tableViewviewForFooterInSection:(NSInteger)section;
//附加按钮的点击消息
-(void)tableView:(UITableView *)tableViewaccessoryButtonTappedForRowWithIndexPath:(NSIndexPath*)indexPath;
// Selection
- (NSIndexPath*)tableView:(UITableView *)tableViewwillSelectRowAtIndexPath:(NSIndexPath *)indexPath;
// Called after the user changes theselection.
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath;
// Editing
-(UITableViewCellEditingStyle)tableView:(UITableView *)tableVieweditingStyleForRowAtIndexPath:(NSIndexPath*)indexPath;
// Indentation缩进
-(NSInteger)tableView:(UITableView*)tableViewindentationLevelForRowAtIndexPath:(NSIndexPath*)indexPath; // return'depth' of row forhierarchies
@end
–tableView:heightForRowAtIndexPath:
设置行高在这里边我们可以通过IndexPath判断是否点击 如果点击 我们kei改变行高
常用代码如下:
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath{
}
如果动态改变行高:那么就需要
–tableView:indentationLevelForRowAt
设置缩进
tableView:numberOfRowsInSection:
特定Section内的行数
numberOfSectionsInTableV
特定数据源的表视图的Section数目
tableView:cellForRowAtIndexPath:
从数据源获取单元格内容并放到特定的行上
sectionIndexTitlesForTab
获取一个数据源的表视图的标题
tableView:commitEditingStyle:forRowAtIndexPath
提交单元格内容的修改
talbeView:canEditRowAtIndexPath:
通过返回一个Boolean类型的值来通知表视图某一行能否修改
tableView:canMoveRowAtIndexPath:
通过返回一个Boolean类型的值来通知表视图某一行能否被移动
tableView:moveRowAtIndexPath:toIndexPath:
允许某一个表视图单元格被移动
@protocolUITableViewDelegate<NSObject,UIScrollViewDelegate>
@optional
// Displaycustomization
-(void)tableView:(UITableView *)tableViewwillDisplayCell:(UITableViewCell *)cellforRowAtIndexPath:(NSIndexPath *)indexPath;
//高的设置
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath;
-(CGFloat)tableView:(UITableView *)tableViewheightForHeaderInSection
-(CGFloat)tableView:(UITableView *)tableViewheightForFooterInSection
// Section header& footer视图设置
- (UIView*)tableView:(UITableView *)tableViewviewForHeaderInSection:(NSInteger)section;
- (UIView*)tableView:(UITableView *)tableViewviewForFooterInSection:(NSInteger)section;
//附加按钮的点击消息
-(void)tableView:(UITableView *)tableViewaccessoryButtonTappedFor
// Selection
- (NSIndexPath*)tableView:(UITableView *)tableViewwillSelectRowAtIndexPath
// Called after the user changes theselection.
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath;
// Editing
-(UITableViewCellEditingSt
// Indentation缩进
-(NSInteger)tableView:(UITableView*)tableViewindentationLeve
@end
- tableview的代理
- iOS---tableView的代理
- tableview的代理分离,帮助控制瘦身
- tableView的数据源及代理方法
- tableView代理函数
- tableView - 常用代理方法
- qt tableview代理实现
- qt tableview代理1
- iOS 使用cell的删除功能,实现tableview的代理
- tableView中几个代理方法调用的顺序
- 为什么TableView 的代理方法cellForRowAtIndexPath 不执行问题
- 一句代码搞定tableView的代理方法
- 点击TableView的Cell没有不走代理方法
- 代理、单例、tableView必写的两个代理方法、block及setter,getter方法
- TableView代理方法详解(一)
- tableView代理方法执行顺序
- tableview自定义空间代理方法
- TableView 代理方法详细解释
- Cell选中时自定义背景
- UIImageview使用网上照片
- UIWebView的使用方法
- UIimageView中图片滚动出现
- 类似qq分组栏-动态分组
- tableview的代理
- Installation error: INSTALL_FAILED_CONFLICTING_PROVIDER 解决方案
- 导航器自制导航按钮
- UIAlertView
- 准备工作完成-1月8日
- presentModalView
- UIActinSheet和UIActionSheetDelegate
- UItableView的类型带图-新手直观图
- IT行业:运维工程师的职责和前景