lv_grid.h

API reference for lv_grid.h

Report on GitHub

Functions

lv_obj_set_grid_dsc_array

 
void lv_obj_set_grid_dsc_array(lv_obj_t *obj, const int32_t col_dsc[], const int32_t row_dsc[])
Parameters
NameType
objlv_obj_t *
col_dscconst int32_t
row_dscconst int32_t

lv_obj_set_grid_align

 
void lv_obj_set_grid_align(lv_obj_t *obj, lv_grid_align_t column_align, lv_grid_align_t row_align)
Parameters
NameType
objlv_obj_t *
column_alignlv_grid_align_t
row_alignlv_grid_align_t

lv_obj_set_grid_cell

Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen

 
void lv_obj_set_grid_cell(lv_obj_t *obj, lv_grid_align_t column_align, int32_t col_pos, int32_t col_span, lv_grid_align_t row_align, int32_t row_pos, int32_t row_span)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
column_alignlv_grid_align_tthe vertical alignment in the cell. LV_GRID_START/END/CENTER/STRETCH
col_posint32_tcolumn ID
col_spanint32_tnumber of columns to take (>= 1)
row_alignlv_grid_align_tthe horizontal alignment in the cell. LV_GRID_START/END/CENTER/STRETCH
row_posint32_trow ID
row_spanint32_tnumber of rows to take (>= 1)

Enums

lv_grid_align_t

Name
LV_GRID_ALIGN_START
LV_GRID_ALIGN_CENTER
LV_GRID_ALIGN_END
LV_GRID_ALIGN_STRETCH
LV_GRID_ALIGN_SPACE_EVENLY
LV_GRID_ALIGN_SPACE_AROUND
LV_GRID_ALIGN_SPACE_BETWEEN
Used by 12 functions
  • lv_obj_set_style_grid_column_align — param value
  • lv_obj_set_style_grid_row_align — param value
  • lv_obj_set_style_grid_cell_x_align — param value
  • lv_obj_set_style_grid_cell_y_align — param value
  • lv_obj_set_grid_align — param column_align
  • lv_obj_set_grid_align — param row_align
  • lv_obj_set_grid_cell — param column_align
  • lv_obj_set_grid_cell — param row_align
  • lv_style_set_grid_column_align — param value
  • lv_style_set_grid_row_align — param value
  • lv_style_set_grid_cell_x_align — param value
  • lv_style_set_grid_cell_y_align — param value

Macros

LV_GRID_FR

 
#define LV_GRID_FR(x) \
    (LV_COORD_MAX - 100 + x)

Can be used track size to make the track fill the free space.

Parameters
NameDescription
xhow much space to take proportionally to other FR tracks

Returns: a special track size

LV_GRID_CONTENT

 
#define LV_GRID_CONTENT (LV_COORD_MAX - 101)

LV_GRID_TEMPLATE_LAST

 
#define LV_GRID_TEMPLATE_LAST (LV_COORD_MAX)

Dependencies

How is this guide?

Last updated on

On this page