I constructing UITableCellView
from xib. This xib uses autolayout
and two UILabel
s connected to superview and have vertical constraint.
Unfortunately it is cutting pixel(s) at the bottom of UILabel
:
What do I missing?
UPD. Xcode is giving me error: Set vertical compression resistance priority to 749
. If I play with compression resistance priority I get first label cut.
Set the priority on the vertical spacing constraint between the two labels to be lower than the vertical spacing constraint between the labels and the top and bottom of the view. Alternatively, in your delegate, override
- (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath
and
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
that will return a height that will accommodate the constraints and label heights. By default I believe you get 44 pixels, so you can get a taller cell by overriding these. Also, you can set the cell height in IB if you're using Storyboards or Nibs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With