开发者

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?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜