views:

38

answers:

1

Hello,

I'm creating an application that consists of a ListView with 5 rows: - 1st one containing a graph - 2nd to 5th rows containing some data with the same formatting.

I have created 2 classes: GraphCustomViewCell and DataCustomViewCell. Depending upon the position of the cell I load the correct CustomCell with:

NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"GraphCustomViewCell" owner:nil options:nil];               
for(id currentObject in topLevelObjects)
{
    if([currentObject isKindOfClass:[GraphCustomViewCell class]])
    {
        cell = (GraphCustomViewCell *)currentObject;
        break;
    }
}

That works fine except that the first row, the one corresponding to the graph, is bigger (in height) that the 4 other rows, and as a results it hides the 3 first other rows.

Is there any option in the table view that enables the custom cell to expand the default cells ? I'd like that the 5 rows (graph + 4 data rows) to fit the entire screen (480 - tabbar's height).

Thanks a lot for your help. Regards, Luc

+1  A: 

You need to implement heightForRowAtIndexPath: in your delegate.

progrmr
Thanks a lot, I did not hear about this method before. Great !!!
Luc