Hey folks!
I'm currently trying to create an InputField that dynamically resizes based on the size of the text content.
I've had great success with the following code:
However when entering any spaces or returns at the end of the text in the input field, the textBounds value doesn't update. It seems that it only registers visible...
TMPro text bounds doesn't count end whitespace
I'm currently trying to create an InputField that dynamically resizes based on the size of the text content.
I've had great success with the following code:
Code (CSharp):
- ((RectTransform)transform).sizeDelta = new Vector2(((RectTransform)transform).sizeDelta.x, Mathf.Max(80, myText.textBounds.size.y + 40));
TMPro text bounds doesn't count end whitespace