0

In the storyboard I have configured my prototype cell to have a height of 132.

enter image description here

So I implemented

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath

to return 132 for this specific row. In the simulator, it shows up like this:

enter image description here

Row 0 is the row with the "Notes" title and row 1 is my special cell with height 132. There are no other rows implemented in this section.

The problem is the trailing rows after row 1 also take on the height of 132. Also, the border between row 1 and "row 2" (I say "row 2" in quotes because I haven't implemented a row 2 but it shows up as a trailing row) is gone for some reason but you can see the separation if I select row 1 as shown here:

enter image description here

So my questions are:

  1. How can I make it so the trailing rows are the default size of 44?
  2. Why is the border between row 1 and "row 2" gone and how can I get it back?
user1529956
  • 735
  • 2
  • 10
  • 24

2 Answers2

0

1) Use this method to set height of rows

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
      int heightRow;
      if(indexPath.row==1)
         heightRow = 132;
      else
          heightRow = 44;
    return heightRow;
}

2) For Border - Check autoresizing of tablecells. Have you implemented default separator or showing it with some image? If you are using an image Try checking it's frame.

Divyu
  • 1,325
  • 9
  • 21
  • I'm already using that method to set the height of the rows and I get the behavior I showed. Where is the autoresizing feature located? The separator is default. – user1529956 Jun 12 '13 at 06:31
0

I figured out the answer to my second question of the border disappearing. I was forgetting to call [super layoutSubviews]

user1529956
  • 735
  • 2
  • 10
  • 24