lv_obj_scroll.h

API reference for lv_obj_scroll.h

Report on GitHub
See Also: Private HeaderThis header has a companion private implementation with internal data structures.lv_obj_scroll_private.h

Functions

lv_obj_set_scrollbar_mode

Set how the scrollbars should behave.

 
void lv_obj_set_scrollbar_mode(lv_obj_t *obj, lv_scrollbar_mode_t mode)
Parameters
NameTypeDescription
objlv_obj_t *pointer to Widget
modelv_scrollbar_mode_tLV_SCROLL_MODE_ON/OFF/AUTO/ACTIVE

lv_obj_set_scroll_dir

Set direction Widget can be scrolled

 
void lv_obj_set_scroll_dir(lv_obj_t *obj, lv_dir_t dir)
Parameters
NameTypeDescription
objlv_obj_t *pointer to Widget
dirlv_dir_tone or more bit-wise OR-ed values of lv_dir_t enumeration

lv_obj_set_scroll_snap_x

Set where to snap the children when scrolling ends horizontally

 
void lv_obj_set_scroll_snap_x(lv_obj_t *obj, lv_scroll_snap_t align)
Parameters
NameTypeDescription
objlv_obj_t *pointer to Widget
alignlv_scroll_snap_tvalue from lv_scroll_snap_t enumeration

lv_obj_set_scroll_snap_y

Set where to snap the children when scrolling ends vertically

 
void lv_obj_set_scroll_snap_y(lv_obj_t *obj, lv_scroll_snap_t align)
Parameters
NameTypeDescription
objlv_obj_t *pointer to Widget
alignlv_scroll_snap_tvalue from lv_scroll_snap_t enumeration

Enums

lv_scrollbar_mode_t

Scrollbar modes: shows when should the scrollbars be visible

NameDescription
LV_SCROLLBAR_MODE_OFFNever show scrollbars
LV_SCROLLBAR_MODE_ONAlways show scrollbars
LV_SCROLLBAR_MODE_ACTIVEShow scroll bars when Widget is being scrolled
LV_SCROLLBAR_MODE_AUTOShow scroll bars when the content is large enough to be scrolled
Used by 1 function
  • lv_obj_set_scrollbar_mode — param mode

lv_scroll_snap_t

Scroll span align options. Tells where to align the snappable children when scroll stops.

NameDescription
LV_SCROLL_SNAP_NONEDo not align, leave where it is
LV_SCROLL_SNAP_STARTAlign to the left/top
LV_SCROLL_SNAP_ENDAlign to the right/bottom
LV_SCROLL_SNAP_CENTERAlign to the center
Used by 2 functions
  • lv_obj_set_scroll_snap_x — param align
  • lv_obj_set_scroll_snap_y — param align

Dependencies

How is this guide?

Last updated on

On this page