Scroll View with text
I have a large amount of text and wanted to put it in a Scroll View so the user can scroll through it.
I did not find any docs about how to do it, but found a blogger who said to do the following: Add Canvas > Panel > ScrollView > Text, and drag the Text as the ScrollView Content property. I did that and added a large body of text. But the run result is that only the text in view is visible, and it doesn't scroll at all.
If I grab the text with my mouse during execution, it lets me drag it, which affects the scroll bars, but it just snaps back. ie. it doesn't scroll. The scroll bars do not show the large amount of text within the ScrollView.
What could be wrong? Here is a picture of how it is setup. Everything is basically at the default.
Answer by Ereona · Aug 10, 2016 at 06:17 AM
Add to Content element components VerticalLayoutGroup and ContentSizeFitter and set Vertical fit of ContentSizeFitter to Preferred Size. Add the Text element as a child of Content element.
I've been struggling for two days with this as well but your way worked just fine. Thanks!
Exactly so.
And make sure that 'Control Child Size' checkboxes are checked.
The pictured configuration worked for my project.
Still works, probably saved me a couple days of frustration. Thanks!
This is such a good answer it should be documented. THAN$$anonymous$$S
Answer by astracat111 · Jun 05, 2018 at 12:27 AM
He didn't mention that you set Content Size Fitter to Unconstrained then drag the horizontal size of your content game object.