Hello,
In NGUI 2.X I remember using something like label.relativeSize.y and that would return the number of lines of the text, which I could use * the height of each line to get the total height of the text. However, I understand that thats changed, and we should use uilabel.height to get the value in pixels. However, heres the problem:
//initially myLabel.text is something equivalent to 1 line of text
print(myLabel.height); //Output 10 (for example, considering 10 pixels per line)
myLabel.text = "asdasdasdasdassad"; //equivalent to 2 lines of text
print(myLabel.height); //Output 10 again, as if size wasnt updated
What I am doing to get the correct value is yield return null, but I would appreciate if I didnt have to wait for a frame and use coroutines for everything. Is it possible to get the updated height immediately?
Thanks for your attention,
Best Regards,
Allan