Adding a scroll view
Some of the instructions may have relatively long body text, and now, with the addition of image or video graphics, it becomes obvious that not all our content may fit on the screen. When you try the app in landscape orientations, it's even more obvious. We need to scroll the content when it overflows the panel.
In the Unity UI, scrolling is implemented using a special scrolling panel:
- Under
Main Canvas
, selectUI | Scroll View
and name itContent Scroll View
. - Set its
Anchor Presets
toStretch/Stretch
, and Alt+click on the same to reset its position. - Make room for the nav bar by setting
Top
to50
. - Uncheck
Horizontal
(keepVertical
) scrolling. - Set its
Source Image
tonone
andColor
to opaque white (#FFFFFFFF).
The other options can be left as the default values. But note that the Scroll Rect
has a reference to its child Viewport
.
When you unfold the Content Scroll View
in Hierarchy
, you can see it has a Content
slot populated with its grandchild Content
. Instead of re-creating...