Hey! I have several labels, and they all have different heights which change with the amount of text. When creating the label, I set the height to 'auto'
I tried looking for the height by displaying "mylabel.height" but that just returned "'auto'"
Is there a way to detect the height of a label once it's been created?
2 Answers
You can try looking at "mylabel.size.height", but this may not work. The value may only be available once it is added to a view or window and actually displayed. There have also been bugs in some versions where this didn't have the correct value, even after doing this.
Good luck, and hope this helps. Allen
Thanks Allen. As you suggested, "mylabel.size.height" didn't return the right value. BUT I took your suggestion and instead did "myTextVariable.length" and was able to get the correct length. Because of this, I can guess what mylabel's height will be.
Thanks!
Your Answer
Think you can help? Login to answer this question!