UILabel 不顯示所有內容 (UILabel not displaying everything)


問題描述

UILabel 不顯示所有內容 (UILabel not displaying everything)

我真的迷失了這個。

這是鏡頭:

在此處輸入圖片描述

Tea's Tea Matcha 的價格……正在被切斷。我根本不知道為什麼。

我正在使用 boundingRectWithSize:...

當我在調用 layoutIfNeeded 後記錄標籤框架的高度時,它應該是高度對於每個相應的框架:與 boundingRect.size.height 相同的高度。

另外,當我記錄標籤的文本時,價格在日誌中,所以也不是這樣。

它'


參考解法

方法 1:

I found I was able to fix the issue by changing the default height constraint constant. I lowered it significantly (it was large enough that it was touching the bottom of the Cell.xib view. I made it spaced closer to the view above it by 1 pixel, lowered the default height constraint constant in IB and changed the type from equals to greater than or equal to. These things combined (I'm not sure which if not all did it) seem to have fixed the problem.

(by Tony FrizTony Friz)

參考文件

  1. UILabel not displaying everything (CC BY‑SA 2.5/3.0/4.0)

#uilabel #iOS #sizetofit #nsstring






相關問題

標籤邊框內的間距 (spacing inside label's border)

awakeFromNib 無法從 UILabel 獲取值,也無法禁用 UIButton (awakeFromNib can't get value from UILabel and can't disable UIButton)

如何在 UILabel 中製作陰影 (How to make shadow in UILabel)

如何計算 UILabel 的字體大小 (How can I calculate font size of UILabel)

如何在情節提要中為uilabel設置大於300的字體大小? (How to set font size greater than 300 for uilabel in storyboard?)

隨著 UILabel 尺寸的增加,在我的 UILabel 周圍獲得額外的空間 (Getting extra space around my UILabel as it increases in size)

UILabel 不顯示所有內容 (UILabel not displaying everything)

在 UIView 中將標籤居中 (Centering a label in a UIView)

UITableViewCell 未在其中顯示 UILabel (UITableViewCell not showing UILabel within)

帶有 UIMenucontroller 的 UILabel 不會通過外部觸摸退出第一響應者 (UILabel with UIMenucontroller not resigning first responder with touch outside)

UILabel 動態高度問題 (UILabel Dynamic height problem)

是否可以將標籤內的文本與“大”框架垂直對齊 (Is it possible to vertically align text inside labels with a "large" frame)







留言討論