Roller (lv_roller)
A wheel-like list where the centered item is the selection.
Overview
The Roller lets the user pick one item from a list by scrolling it like a wheel. The centered item is the selected one and is usually styled to stand out from the rest.
Learn more in the LVGL Open documentation.
Enumerations
lv_roller_mode — How the roller scrolls
| Value | Description |
|---|---|
normal | Stop at first and last option |
infinite | Scroll endlessly in a loop |
Properties
Parts
Style parts of the widget with local style (e.g. style_bg_color-knob="0xff0000") or with style sheets (e.g. <style name="style_knob" selector="knob">). See Styles to learn more.
| Part | Description |
|---|---|
main | The background and option list: background and text properties. text_line_space sets the row spacing (and the height of the selected band); anim_duration sets the scroll animation time. |
selected | The option in the middle band: text and background properties to highlight the selected row. Can use different font than main |
Properties below are the widget's XML <api>; see API for how properties, parameters and elements work.
| Property | Type | Description |
|---|---|---|
options | string | Set the roller options |
options-mode | enum:lv_roller_mode | Set the roller mode (reference as options-mode) (default: normal) |
selected | int | Set the selected option |
selected-animated | bool | Animate the selection (reference as selected-animated) (default: false) |
visible_row_count | int | Show this many rows at once |
bind_value | subject | Bind the selected option to a subject |
Last updated on