How to Wrap words in UILabel

。_饼干妹妹 提交于 2019-12-12 17:23:15

问题


I have a UILabel thats inside a Custom UITableViewCell, I am trying to get the word to wrap inside the UILabel.. But I am having some issues.

This is how the UITableViewCell looks in Interface Builder

The UILabel Label needs to wrap.. So in Interface Builder I have set the labels lines to 0 (which I think means multiple lines), and the line break to words.. which should wrap the words..

However now I think I have to put some code into something so that if the word wraps it expands the cell.. which I am not sure how to do.. I was wondering if anyone else here has experienced this issue before and could help me out.


回答1:


Try increasing the height of the UILabel. It will only wrap words if it can fit the next line within the frame of the label.




回答2:


Could it be to do with the UITableViewCell height. Perhaps you are not allowing for the cell to grow



来源:https://stackoverflow.com/questions/8888802/how-to-wrap-words-in-uilabel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!