简体   繁体   中英

how to break uilabel line in swift?

I really can't figure it out how to break line at ui label when it reach it max width.It keep showing me "xxxxx....".So,is there any other way that I can do line break at uilabel in swift?I am sure that the data string that i fetch from json will be more longer than like this.So,any idea?

I already set numberOfLines to zero which still didn't work out.

在此处输入链接说明

Actually the text is "(2010) Toyota Corolla Fielder has won from our system!!!"

I don't know why the previous answer was removed, but I managed to grab the screenshot of your constraints for the label :

在此处输入图片说明

We can see from it that your label has constraint on its height made by its top and bottom constraints. It simply cannot grow vertically without breaking any of this constraints. To resolve your issue I'd suggest changing the Bottom Space to: constraint to be a Less than or equal constraint. To do this double click on the constraint in the inspector, and change the Relation in the menu.

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