2

I am using this code [cell setIndentationLevel:7]; with normal UITableViewCell but it display too difference between iOS 6 and iOS 7.

iOS 6 and ealier enter image description here

iOS 7

enter image description here

How can i fix iOS 7's error?

Thank you

Marco
  • 6,692
  • 2
  • 27
  • 38
Nam Vu
  • 5,669
  • 7
  • 58
  • 90

1 Answers1

4

Similar questions UITableViewCell imageView padding and ios7 uitableviewcell image left offset offer solution over subclassing. In iOS7 UIImageView sticks to left edge and you need to reposition it manually.

In your case position is based on indentation level:

- (void)layoutSubviews
{
    [super layoutSubviews];

    CGRect frame = self.imageView.frame;
    frame.origin.x = self.indentationLevel*self.indentationWidth;
    self.imageView.frame = frame;
}
Community
  • 1
  • 1
vokilam
  • 10,153
  • 3
  • 45
  • 56