Having a strange issue using Auto Layout with a UILabel where it resizes almost to its content size less one line (driving me nuts). So basically, it seems to get to where it should minus a few pixels causing an ellipses at the end when downsizing to the iPhone 5 or 6. It works fine on the 6+, which is what the XIB is sized for.
Here's what the XIB looks like and what I have the constraints set to. The label is the "Big long label here is the event description".
Based upon this stack post, I thought I was going to figure it out. I tried both methods mentioned in the post. All four of the constraints in the screenshot are set to 1,000. If I do what the post says and add a height constraint with priority of 500, which is less than the vertical hugging and vertical compression resistance priorities, it still doesn't work. I've also just not set the height constraint, kept the preferred width set and had leading and trailing space constraints set, which was mentioned in the comments. The number of lines is set to 0.
To try to give more detail, the UILabel
is in a UIView
set as contentView
. I then add the contentView
to a UIScrollView
. The UIScrollView
is being automatically sized by pinning the contentView
at 0 to all four sides. The contentContainer
is also constrained to the screen width (not ideal but only way I've been able to get it to work - not sure if it has anything to do with this issue). I'm not getting any constraint issues in the console. translatesAutoresizingMaskIntoContraints
is set to NO
for the contentView
. Here's what the UILabel
looks like when ran:
It should be one line longer at the bottom to fit. Someone please help me!