UITableViewCell is 1px shorter in didSelectRowAtIndexPath than cellForRowAtIndexPath
I have a UITableViewCell that I create in tableView:cellForRowAtIndexPath:. In that method I call:
UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease];
NSLog(@"Cell height: %f", cell.contentView.frame.size.height);
This gives me a return value of 44.000000.
Then in my tableView:didSelectRowAtIndexPath: method, I call:
UITableViewCell *cell = [tableView开发者_JS百科 cellForRowAtIndexPath: indexPath];
NSLog(@"Cell height: %f", cell.contentView.frame.size.height);
And this gives me a return value of 43.000000. Aren't they the same cell? What gives?
I would chock this one up to Apple's behind-the-scenes highlighting magic.
This is probably due to the separator. Have you looked into that?
加载中,请稍侯......
精彩评论