Question:
When I set rowHeight to a UITableView , shouldn't the cell height also be changed?
Here is a situation that makes me think about it:
I want to set a separate row for each cell of the table view below, what else, I want to set the row height for it from 44 to 32 . The result I want is as follows:

Setting the line height is done correctly:
- (void)viewDidLoad { [super viewDidLoad]; [self.tableView setRowHeight:32.0f]; [self.tableView setSeparatorStyle:UITableViewCellSeparatorStyleNone];
However, when I added a separate row for the cell, I ran into a problem: I want to set a separate row at the bottom of the cell, so I set the position of y on cell.frame.size.height - 1.0f . Unfortunately, the result is shown below:

When I made the selection, the cell changed as shown below:
1. Selected line No. 1:

2. Selected line No. 2:

3. Selected row No. 3:

It seems that the cell height before it was selected was 44 , when it is selected, it has changed to 32 . They were overlapped one by one, like cards, right? Weird!
Main code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *cellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease]; [cell.textLabel setFont:[UIFont fontWithName:@"Futura-Medium" size:15.0f]]; UIView * seperateLine = [[UIView alloc] initWithFrame:CGRectMake(10.0f, cell.frame.size.height - 1.0f, 300.0f, 1.0f)]; NSLog(@">>>>>>>>>>>>>>>> %f", cell.frame.size.height); [seperateLine setBackgroundColor:[UIColor grayColor]]; [cell.contentView addSubview:seperateLine]; [seperateLine release]; }
I tried checking cell.frame.size.height , and finally it was 44 . And then I will replace the line
UIView * seperateLine = [[UIView alloc] initWithFrame:CGRectMake(10.0f, cell.frame.size.height - 1.0f, 300.0f, 1.0f)];
to
UIView * seperateLine = [[UIView alloc] initWithFrame:CGRectMake(10.0f, 31.0f, 300.0f, 1.0f)];
It worked as the first image shown above. But the cell height was still 44 , they (which we just don't see completely) still overlap. What I did was just add a separate line , where y position 32 , but its total height is 44 .
So what do you think of this ?: