设置关于tableview行:
–tableView:heightForRowAtIndexPath:
设置行高在这里边我们可以通过IndexPath判断是否点击 如果点击 我们kei改变行高
常用代码如下:
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath{
if (indexPath.row!=selectedRow)
return 72.0f;
else return 100f;
}
如果动态改变行高:那么就需要
–tableView:indentationLevelForRowAt IndexPath:
设置缩进
–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 *)tableViewaccessoryButtonTappedFor RowWithIndexPath:(NSIndexPath*)indexPath;
// Selection
- (NSIndexPath*)tableView:(UITableView *)tableViewwillSelectRowAtIndexPath :(NSIndexPath *)indexPath;
// Called after the user changes theselection.
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath;
// Editing
-(UITableViewCellEditingSt yle)tableView:(UITableView *)tableVieweditingStyleForRowAtInde xPath:(NSIndexPath*)indexPath;
// Indentation缩进
-(NSInteger)tableView:(UITableView*)tableViewindentationLeve lForRowAtIndexPath:(NSIndexPath*)indexPath; // return'depth' of row forhierarchies
@end
–tableView:heightForRowAtIndexPath:
设置行高在这里边我们可以通过IndexPath判断是否点击 如果点击 我们kei改变行高
常用代码如下:
-(CGFloat)tableView:(UITableView *)tableViewheightForRowAtIndexPath:(NSIndexPath *)indexPath{
}
如果动态改变行高:那么就需要
–tableView:indentationLevelForRowAt
设置缩进
–tableView:willDisplayCell:forRowAtIndexPath:
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