- (NSString *)tableView:(UItableView *)tableView titleForHeaderInsection:(NSInteger)section {
    return [NSString stringWithFormat:@" %@ ", [SECTION_ARRAY objectAtIndex:section]];
}

반응형





-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 높이;
}


<응용>
 
// 행높이
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 
    if (indexPath.row == timeLineCount-1) {
    return 40;
    } else {
        UIFont *font = [UIFont systemFontOfSize:13];
        CGSize withinSize = CGSizeMake(300, 80);
        CGSize size = [[lastestTweets objectAtIndex:indexPath.row] sizeWithFont:font constrainedToSize:withinSize lineBreakMode:UILineBreakModeWordWrap];
        UIFont *font2 = [UIFont systemFontOfSize:11];
        CGSize withinSize2 = CGSizeMake(300, 80);
        CGSize size2 = [[userAccountName objectAtIndex:indexPath.row] sizeWithFont:font2 constrainedToSize:withinSize2 lineBreakMode:UILineBreakModeWordWrap];
        return (size.height+ size2.height)*2;
    }
}

반응형





if (cell == nil) {
    ...
    // '>' 모양. 보통 하위 카테고리로 진입시 사용
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
    ...
}

반응형