I am using a UILabel
within a tableViewCell
. Some of the cells have texts that are one line, and some 2 lines. I have set the trailing space, leading space and top space from superview constraints to the label. Following are the settings:
- lines = 0
- Line Breaks: Word Wrap (tried other options as well)
If the text crosses a particular length, for some reason, the label height seems to have increased to accommodate 2 lines, though the text is only one line. As show below (background is red for reference):
For example, In the first row, the actual text is one line, but the height is increased when compared to the other rows.
Is there any reason why it might be happening so? I am not setting the height anywhere from the code.
EDIT
Also, I have set a custom font for UILabel throughout out the App using the following:
[[UILabel appearance] setFont:myFont];
I am not sure if that should cause any issue..
Also, the screen shot of the constraints set are: