Two different heights for sectionHeaderView

Your code is wrong try this:

 - (CGFloat)tableView:(UITableView *)tableView heightForViewForHeaderInSection:     (NSIndexPath *)indexPath
    {
        if(indexPath.section == 0) // First section
        {
            return 300;
        } else if(indexPath.section == 1) { // Second
            return 50;
        }
        else { // Any other section
            return 40.0; // Default
        }
  }

Leave a Comment