A bug related to Uilabel was resolved today.
Performance for the system above iOS7, Uilabel can automatically wrap, multi-line display of the string, and on the iOS6 above will not automatically wrap, directly hit the ellipsis.
Under normal circumstances, NumberOfLines is set to 0,uilabel and will wrap automatically.
However, you need to set preferredmaxlayoutwidth,autolayout below the iOS6 to determine the position of the line, in order to correctly display the multi-line Uilabel
But how much is preferredmaxlayoutwidth set to be correct?
If you know an exact width of course is the best, then directly set it up,
However, if the width of the Uilabel is adaptive and uncertain, then the following code can be used to set the
-(void) layoutsubviews{ [Super layoutsubviews]; Self.label.preferredMaxLayoutWidth = Self.label.bounds.size.width;}
When the label is already displayed on the interface, the width is determined and can be set directly with the width as the maximum autolayout width. This is normal.
UILabel AutoLayout Line-break version differences