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

ValueDescription
normalStop at first and last option
infiniteScroll 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.

PartDescription
mainThe 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.
selectedThe 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.

PropertyTypeDescription
optionsstringSet the roller options
options-modeenum:lv_roller_modeSet the roller mode (reference as options-mode) (default: normal)
selectedintSet the selected option
selected-animatedboolAnimate the selection (reference as selected-animated) (default: false)
visible_row_countintShow this many rows at once
bind_valuesubjectBind the selected option to a subject

Last updated on

On this page