UILabel没有显示我的所有文字,也没有显示有更多(...) [英] UILabel does not show all my text and it also doesn't show that there is more (...)

查看:312
本文介绍了UILabel没有显示我的所有文字,也没有显示有更多(...)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我动态确定单元格的高度,以适合我的所有文本。

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

我还将行数设置为0。

大部分时间都可以使用,但有时我会得到这样的结果:

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

文字比显示的文字多,即使我记录标签文字,它显示了更多显示的内容。

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 but its been driving me crazy.

推荐答案

解决方案实际上非常简单,由于某种原因,行数被改变,所以现在我只确保在单元格显示之前,nu该标签的线条实际上是0。

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.

谢谢大家的帮助!

这篇关于UILabel没有显示我的所有文字,也没有显示有更多(...)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆