简体   繁体   中英

Can't multiline UILabel on iOS 8.3 using xCode 7.2

With autolayout on xCode 7.2 I can't multiline UILabel on iOS 8.3 while it is getting very well multiline on iOS 9.2 . I am sure it is due to version I currently am. Earlier with the same constraints I was able to multiline using xCode 6.3 for iOS 8.3 .

Constraints are :

在此处输入图片说明

and numberoflines set to 0

I think it will help you

first set line breaks Mode=Word Warp and then give number of lines

在此处输入图片说明

What I needed to do is reset the layout engine for this particular label. After setting label's text. Now it works fine in iOS 7,8 and 9. Still don't why this solved version issues.

[lblName layoutIfNeeded];

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM