1

The cell is not indenting according to is level.

I have configured indentation width inside cellForRowAtIndexPath.

- (NSInteger)tableView:(UITableView *)tableView indentationLevelForRowAtIndexPath:(NSIndexPath *)indexPath{

            NSInteger theLevel=0;
            if ( indexPath.row==1) {
                theLevel=5;
            }
            return theLevel;
        }

In the below image I changed frame frame of button and label according to its level.

enter image description here

Saurav
  • 537
  • 4
  • 20

1 Answers1

0

If you have added subviews to the cell then you need to set the subviews' autoresizing masks so that they are repositioned when the contentView size gets changed.

Please look at this answer.

Community
  • 1
  • 1
βhargavḯ
  • 9,786
  • 1
  • 37
  • 59
  • Even I have removed subviews and then tried to indent still its not working – Saurav Feb 20 '13 at 06:04
  • UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]autorelease]; cell.selectionStyle=UITableViewCellSelectionStyleBlue; // Add button(expand/collapse) and label on cells. [self addSubviewsToCell :cell]; }return cell; } – Saurav Feb 20 '13 at 11:16
  • Please Edit your question and post code there. [self addSubviewsToCell :cell] is commented ? – βhargavḯ Feb 20 '13 at 11:39