Reputation: 63
When I initialize a textlabel from a static tableview cell in viewDidLoad, everything is displayed as it should be. However when I change the textvalue some moments later after the press of a button, the text is clipped if it was bigger than the original text set in viewDidLoad. When the new text is shorter, it's being displayed correctly.
Somebody knows a solution for this problem?
-- EDIT --
Solved with:
try calling the label's setNeedsLayout method after changing the text value - that may resize the label. –
Upvotes: 1
Views: 224
Reputation: 1900
Set the adjustsFontSizeToFitWidth property of the label to YES. It will make the font smaller when text becomes longer. Also set the minimumFontSize property to a smaller value than the default.
Upvotes: 1