scroll Widget
A scroll Widget displays a child widget. When the child widget is taller than the available space, the user can drag on the widget to scroll it.
The user can also drag down to poll the page. This function is known as "pull to refresh".
Attributes:
widget: Widget
- Required
- The widget to display inside the scroll widget
pull_to_refresh: true
- Set to
false
to disable the pull-to-refresh function.
- Set to
Example
# Ruby
nav_page(title: "Inert") {
scroll {
form(widgets: [
text("This page updates when you load or refresh it (pull to refresh)."),
text(Time.new.strftime("%Y-%m-%d %H:%M:%S")),
])
}
}
#![allow(unused)] fn main() { nav_page( "Inert", scroll(form(( text("This page updates when you load or refresh it (pull to refresh)."), text(format!("{:?}", SystemTime::now())), ))), ) }