iOS 8.4:
Exact same code on iOS 9:
As you can see, exact same code being run on iOS 8.4 yields different results to iOS 9.
On iOS 9, the second line shows for a split second when the view is first loaded and then shrinks back to its single line state. This view is a Header Collection Reusable View.
I tried removing all other views and unrelated constraints in the header view whilst leaving only the label in question (with 3 constraints) but still yields similar results, so it couldn't be caused by other constraints in the view.
Was wondering if anyone else is experiencing this and know of a solution?
EDIT 1:
Configurations for the UILabel:
EDIT 2:
I created a demo project here: https://github.com/v-ken/TestMultilineUILabeliOS9. I located the source of the problem to be reloadData
. When it's called, the UILabel
shrinks back to a single line.
EDIT 3:
Demo GIT repository above is now updated with the fix.