开发者

UILabel does not show all my text and it also doesn't show that there is more (...)

I am determining the height of my cells dynamically, to fit all my text.

I also set the number of lines to 0.

It works most of the time but sometimes I get things like this:

UILabel does not show all my text and it also doesn't show that there is more (...)

There is more text than is shown, and even if I log the label text, it shows more that what is being displayed.

The black frame is used to show that the frame is big enough to hold the text but for some reason the label refuses to show all my text.

Has anyone experienced anything like this?

Can anyone help me solve this?

I know it's not complicated开发者_StackOverflow中文版 but its been driving me crazy.


In this instance, it is very important to use the correct function to measure the size of your text. Check out this blog post: Calculating Height of Multi-Line Text on the iPhone SDK.


The solution was actually very simple, for some reason, the number of lines was being changed, so now I only make sure that before the cell is displayed, the number of lines for the label is in fact 0.

Thank you all for the help!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜