lv_flex.h

API reference for lv_flex.h

Report on GitHub

Functions

lv_obj_set_flex_flow

Set how the item should flow

 
void lv_obj_set_flex_flow(lv_obj_t *obj, lv_flex_flow_t flow)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object. The parent must have flex layout else nothing will happen.
flowlv_flex_flow_tan element of lv_flex_flow_t.

lv_obj_set_flex_align

Set how to place (where to align) the items and tracks

 
void lv_obj_set_flex_align(lv_obj_t *obj, lv_flex_align_t main_place, lv_flex_align_t cross_place, lv_flex_align_t track_cross_place)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object. The parent must have flex layout else nothing will happen.
main_placelv_flex_align_twhere to place the items on main axis (in their track). Any value of lv_flex_align_t.
cross_placelv_flex_align_twhere to place the item in their track on the cross axis. LV_FLEX_ALIGN_START/END/CENTER
track_cross_placelv_flex_align_twhere to place the tracks in the cross direction. Any value of lv_flex_align_t.

lv_obj_set_flex_grow

Sets the width or height (on main axis) to grow the object in order fill the free space

 
void lv_obj_set_flex_grow(lv_obj_t *obj, uint8_t grow)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object. The parent must have flex layout else nothing will happen.
growuint8_ta value to set how much free space to take proportionally to other growing items.

Enums

lv_flex_align_t

Name
LV_FLEX_ALIGN_START
LV_FLEX_ALIGN_END
LV_FLEX_ALIGN_CENTER
LV_FLEX_ALIGN_SPACE_EVENLY
LV_FLEX_ALIGN_SPACE_AROUND
LV_FLEX_ALIGN_SPACE_BETWEEN
Used by 9 functions
  • lv_obj_set_style_flex_main_place — param value
  • lv_obj_set_style_flex_cross_place — param value
  • lv_obj_set_style_flex_track_place — param value
  • lv_obj_set_flex_align — param main_place
  • lv_obj_set_flex_align — param cross_place
  • lv_obj_set_flex_align — param track_cross_place
  • lv_style_set_flex_main_place — param value
  • lv_style_set_flex_cross_place — param value
  • lv_style_set_flex_track_place — param value

lv_flex_flow_t

NameValue
LV_FLEX_FLOW_ROW0x00
LV_FLEX_FLOW_COLUMN(1 << 0)
LV_FLEX_FLOW_ROW_WRAPLV_FLEX_FLOW_ROW | (1 << 2)
LV_FLEX_FLOW_ROW_REVERSELV_FLEX_FLOW_ROW | (1 << 3)
LV_FLEX_FLOW_ROW_WRAP_REVERSELV_FLEX_FLOW_ROW | (1 << 2) | (1 << 3)
LV_FLEX_FLOW_COLUMN_WRAPLV_FLEX_FLOW_COLUMN | (1 << 2)
LV_FLEX_FLOW_COLUMN_REVERSELV_FLEX_FLOW_COLUMN | (1 << 3)
LV_FLEX_FLOW_COLUMN_WRAP_REVERSELV_FLEX_FLOW_COLUMN | (1 << 2) | (1 << 3)
Used by 3 functions
  • lv_obj_set_style_flex_flow — param value
  • lv_obj_set_flex_flow — param flow
  • lv_style_set_flex_flow — param value

Macros

LV_FLEX_COLUMN

 
#define LV_FLEX_COLUMN (1 << 0)

LV_FLEX_WRAP

 
#define LV_FLEX_WRAP (1 << 2)

LV_FLEX_REVERSE

 
#define LV_FLEX_REVERSE (1 << 3)

Dependencies

How is this guide?

Last updated on

On this page