#pragma mark - < UITableViewDelegate>
//點擊Cell時調用函數
- (void)tableView:(UITableView*)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath
{
NSLog(@"第%zd行",indexPath.row);
}
/**
*取消選中某一行時候調用
*@param indexPath被取消選中那一行《當另一行被選中,前面選中對的行被取消》
*/
- (void)tableView:(UITableView*)tableView didDeselectRowAtIndexPath:(NSIndexPath*)indexPath
{NSLog(@"被取消的第%zd行",indexPath.row);}
*告訴第indexpath行高
- (CGFloat)tableView:(UITableView*)tableView heightForRowAtIndexPath:(NSIndexPath*)indexPath
{if(indexPath.row%2==0) {return20;}
return100;}
在頭部分區高度設置
- (CGFloat)tableView:(UITableView*)tableView heightForHeaderInSection:(NSInteger)section
{
return60;
}
分區的頭部返回一個UIView
- (UIView*)tableView:(UITableView*)tableView viewForHeaderInSection:(NSInteger)section
{
return[UIButtonbuttonWithType:UIButtonTypeContactAdd];
}
- (void)scrollViewDidScroll:(UIScrollView*)scrollView
{
NSLog(@"---*********----%@",scrollView);
}