Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is contentView height of UITableViewCell always one point smaller than the UITableViewCell?

My cells, at the UITableViewCell level, have a height of 44 points. The contentView says 43 points, and it's greyed out in IB. How can I make the content the same size as the cell?

Note that I'm designing my cells in separate xib files.

I want my cells to have no margin between each other.

I have also set None as separator style of the table view. Row height in IB is also set to 44 points. Not using any sections.

like image 901
Jonny Avatar asked May 18 '15 01:05

Jonny


1 Answers

If you're using storyboards setting the Separator of the tableView to None (instead of Default) gets rid of the 1pt separator and the contentView's height becomes equal to the cell's height (even though it's grayed out)

Note: This solution doesn't work with xib files (at least doesn't update the IB, didn't check at run-time).

like image 173
Islam Avatar answered Sep 24 '22 12:09

Islam