Reputation: 144
In Unity, I want to implement a vertical scrollbar automatically according to the amount of text in the input field. However, although I set it in the following format, the text view does not increase dynamically even when the amount of text increases. Please tell me the cause.[enter image description here]2
Upvotes: 0
Views: 1156
Reputation: 71
Unfortunately unity's UI components do not really have that functionality. You could try to resize the ScrollRect transform component by counting on the characters in the Text component. I believe the Text component has an event that is called every time it's text value is changed, so you should be able to tie your function that updates the scale of the ScrollRect component to that event.
This is just a suggestion, I remember actually doing this at some point, but I don't have access to that code right now. Hopefully this will point you in the right direction.
Upvotes: 1