tableview的代理

设置关于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:

tableView:numberOfRowsInSection:

特定Section内的行数

numberOfSectionsInTableView:

特定数据源的表视图的Section数目

tableView:cellForRowAtIndexPath:

从数据源获取单元格内容并放到特定的行上

sectionIndexTitlesForTableView:

获取一个数据源的表视图的标题

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:(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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值