Scroll

Show a part of view with scrollbar.

Header#include "nativeui/scroll.h"
Namespacenamespace nu
Typeclass (RefCounted)
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.

Constructors

Scroll()

Create a new Scroll view.

Class properties

const char* kClassName

The class name of this view.

Methods

void SetContentView(View* view)

Set the content view.

Parameters

View* GetContentView() const

Return the content view.

Return

View*

void SetContentSize(const SizeF& size)

Set the size of content view.

Parameters

SizeF GetContentSize() const

Return the size of content view.

Return

SizeF

void SetScrollbarPolicy(Scroll::Policy hpolicy, Scroll::Policy vpolicy)

Change the display policy for horizontal and vertical scrollbars.

Parameters

std::tuple<Scroll::Policy, Scroll::Policy> GetScrollbarPolicy() const

Return the display policy of horizontal and vertical scrollbars.

Return

std::tuple<Scroll::Policy, Scroll::Policy>