Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


ScrollView

Displays its contents inside a scrollable frame. For more information, see ScrollView.
Read time 8 minutesLast updated 2 days ago

Definition

public class ScrollView : VisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler

Static Fields

Value

Description

contentAndVerticalScrollUssClassNameUSS class name of content elements in elements of this type.
contentUssClassNameUSS class name of content elements in elements of this type.
horizontalVariantContentUssClassNameUSS class name that's added when the ContentContainer is in horizontal mode. ScrollViewMode.Horizontal
horizontalVariantUssClassNameUSS class name that's added when the ScrollView is in horizontal mode. ScrollViewMode.Horizontal
horizontalVariantViewportUssClassNameUSS class name that's added when the Viewport is in horizontal mode. ScrollViewMode.Horizontal
hScrollerUssClassNameUSS class name of horizontal scrollers in elements of this type.
ussClassNameUSS class name of elements of this type.
verticalHorizontalVariantContentUssClassNameUSS class name that's added when the ContentContainer is in both horizontal and vertical mode. ScrollViewMode.VerticalAndHorizontal
verticalHorizontalVariantUssClassNameUSS class name that's added when the ScrollView is in both horizontal and vertical mode. ScrollViewMode.VerticalAndHorizontal
verticalHorizontalVariantViewportUssClassNameUSS class name that's added when the Viewport is in both horizontal and vertical mode. ScrollViewMode.VerticalAndHorizontal
verticalVariantContentUssClassNameUSS class name that's added when the ContentContainer is in vertical mode. ScrollViewMode.Vertical
verticalVariantUssClassNameUSS class name that's added when the ScrollView is in vertical mode. ScrollViewMode.Vertical
verticalVariantViewportUssClassNameUSS class name that's added when the Viewport is in vertical mode. ScrollViewMode.Vertical
viewportUssClassNameUSS class name of viewport elements in elements of this type.
vScrollerUssClassNameUSS class name of vertical scrollers in elements of this type.

Constructors

Constructor

Description

ScrollView()Constructor.
ScrollView(UnityEngine.UIElements.ScrollViewMode)Constructor.

Properties

Property

Description

contentContainerContains full content, potentially partially visible.
contentViewportRepresents the visible part of contentContainer.
elasticAnimationIntervalMsThe minimum amount of time, in milliseconds, between executions of elastic spring animation.
elasticityThe amount of elasticity to use when a user tries to scroll past the boundaries of the scroll view.
horizontalPageSizeThis property controls the speed of the horizontal scrolling when using a keyboard or the on-screen scrollbar buttons (arrows and handle), based on the size of the page.
horizontalScrollerHorizontal scrollbar.
horizontalScrollerVisibilitySpecifies whether the horizontal scroll bar is visible.
modeControls how the ScrollView allows the user to scroll the contents. ScrollViewMode
mouseWheelScrollSizeThis property controls the scrolling speed only when using a mouse scroll wheel, based on the size of the page. It takes precedence over the --unity-metrics-single_line-height USS variable.
nestedInteractionKindThe behavior to use when scrolling reaches limits of a nested ScrollView.
scrollDecelerationRateControls the rate at which the scrolling movement slows after a user scrolls using a touch interaction.
scrollOffsetThe current scrolling position.
touchScrollBehaviorThe behavior to use when a user tries to scroll past the boundaries of the ScrollView content using a touch interaction.
verticalPageSizeThis property controls the speed of the vertical scrolling when using a keyboard or the on-screen scrollbar buttons (arrows and handle), based on the size of the page.
verticalScrollerGets the vertical scrollbar for the scroll view.
verticalScrollerVisibilitySpecifies whether the vertical scroll bar is visible.

Methods

Method

Description

ScrollToScroll to a specific child element.

Enums

Enum

Description

ScrollView.NestedInteractionKindOptions for controlling how nested ScrollView handles scrolling when reaching the limits of the scrollable area.
ScrollView.TouchScrollBehaviorThe behavior to use when a user tries to scroll past the end of the ScrollView content using a touch interaction.

Inheritance

Inherited Members