Scroll

Show a part of view with scrollbar.

Modulerequire("yue.gui")
TypeClass
InheritsView

The Scroll view can show an arbitrary content view inside it.

When the content is larger than the Scroll view, scrollbars will be optionally showed. When the content view is smaller then the Scroll view, the content view will be resized to the size of the Scroll view.

Class methods

create()

Create a new Scroll view.

Return

Scroll

Methods

setcontentview(view)

Set the content view.

Parameters

getcontentview()

Return the content view.

Return

View

setcontentsize(size)

Set the size of content view.

Parameters

getcontentsize()

Return the size of content view.

Return

SizeF

setscrollposition(horizon, vertical)

Scroll to the horizon and vertical position.

Parameters

getscrollposition()

Return the horizon and vertical scroll position.

Return

number, number

getmaximumscrollposition()

Return the maximum horizon and vertical scroll position.

Return

number, number

setoverlayscrollbar(overlay) macOS linux

Set whether to use overlay scrolling.

Parameters

isoverlayscrollbar() macOS linux

Return whether overlay scrolling is used.

Return

boolean

setscrollbarpolicy(hpolicy, vpolicy)

Set the policy for displaying horizontal and vertical scrollbars.

Parameters

getscrollbarpolicy()

Return the display policy of horizontal and vertical scrollbars.

Return

Scroll::Policy, Scroll::Policy

setscrollelasticity(helasticity, velasticity) macOS

Set horizontal and vertical scroll elasticity (bounce).

Parameters

getscrollelasticity() macOS

Return the horizontal and vertical scroll elasticity.

Return

Scroll::Elasticity, Scroll::Elasticity

Events

onscroll(self)

Emitted when the content view is being scrolled.

Parameters

Preventable

No.