lv_flex.h

Defines

_LV_FLEX_COLUMN
_LV_FLEX_WRAP
_LV_FLEX_REVERSE

Enums

enum lv_flex_align_t

Values:

enumerator LV_FLEX_ALIGN_START
enumerator LV_FLEX_ALIGN_END
enumerator LV_FLEX_ALIGN_CENTER
enumerator LV_FLEX_ALIGN_SPACE_EVENLY
enumerator LV_FLEX_ALIGN_SPACE_AROUND
enumerator LV_FLEX_ALIGN_SPACE_BETWEEN
enum lv_flex_flow_t

Values:

enumerator LV_FLEX_FLOW_ROW
enumerator LV_FLEX_FLOW_COLUMN
enumerator LV_FLEX_FLOW_ROW_WRAP
enumerator LV_FLEX_FLOW_ROW_REVERSE
enumerator LV_FLEX_FLOW_ROW_WRAP_REVERSE
enumerator LV_FLEX_FLOW_COLUMN_WRAP
enumerator LV_FLEX_FLOW_COLUMN_REVERSE
enumerator LV_FLEX_FLOW_COLUMN_WRAP_REVERSE

Functions

void lv_flex_init(void)

Initialize a flex layout the default values

Parameters:

flex -- pointer to a flex layout descriptor

void lv_obj_set_flex_flow(struct _lv_obj_t *obj, lv_flex_flow_t flow)

Set how the item should flow

Parameters:
  • obj -- pointer to an object. The parent must have flex layout else nothing will happen.

  • flow -- an element of lv_flex_flow_t.

void lv_obj_set_flex_align(struct _lv_obj_t *obj, lv_flex_align_t main_place, lv_flex_align_t cross_place, lv_flex_align_t track_cross_place)

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

Parameters:
  • obj -- pointer to an object. The parent must have flex layout else nothing will happen.

  • main_place -- where to place the items on main axis (in their track). Any value of lv_flex_align_t.

  • cross_place -- where to place the item in their track on the cross axis. LV_FLEX_ALIGN_START/END/CENTER

  • track_cross_place -- where to place the tracks in the cross direction. Any value of lv_flex_align_t.

void lv_obj_set_flex_grow(struct _lv_obj_t *obj, uint8_t grow)

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

Parameters:
  • obj -- pointer to an object. The parent must have flex layout else nothing will happen.

  • grow -- a value to set how much free space to take proportionally to other growing items.