Wednesday, 14 December 2011

Titles of Header,Footer and Index and Indent in Table view-iPhone

-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    return @"Section title";
}
- (NSString *)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section {
    return @"Footer title";
}



- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
    NSMutableArray *index = [[NSMutableArray alloc] initWithObjects:@"A",@"B",@"C",@"D",nil];
    return index;
}


- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath {
    if (indexPath.row == 3) return 2;
    return 0;
}

No comments:

Post a Comment