Tiziano
Tiziano

Reputation: 346

Grouped UITableView and cell design problems

i've designed a UITableView in an app that i'm developing The view is designed in interface builder and table style is set to grouped there But i'm facing a little problem in table design. As You can see in the screenshot below the first separator is bolder than normal borders and as you can note in the second screenshot the separator in the last sections doesn't appear at all. As because there's no problem if table have only two sections and not three i'm thinking that there may be a problem in dequeuereusableCellWithIdentifier, but i can't manage to resolve the issue. Table Cell is a subclass of UITableViewCell designed in interface builder and loaded by using this code

 NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"GraphiDetailTableCell" owner:self options:nil];
 cell = (GraphiDetailTableCell *)[topLevelObjects objectAtIndex:0];

I've checked that the cellIdentifier is the same in interface builder and in cellForRowAtIndexPath Thanks in advance if anybody can help me facing this problem . first screenshot second screenshot

Upvotes: 0

Views: 238

Answers (2)

Tiziano
Tiziano

Reputation: 346

It was my fault. i have forget to implement the heightForRowAtIndexPath method. I've had set it only in the xib file

Upvotes: 0

MarioGT
MarioGT

Reputation: 682

Your code for create the cell in the delegate method its something like that ?

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];

    if (!cell) {

        cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"UITableViewCell"]autorelease];
    }


    /* your code */


    return cell;
}

Upvotes: 1

Related Questions