To modify the minimum space Grid inserts between objects, the following properties can be set on the Grid container style:
pad_row Sets the padding between the rows.
pad_column Sets the padding between the columns.
Other features
RTL
英文
|
自動翻訳
|
If the base direction of the container is set to LV_BASE_DIR_RTL , the meaning of LV_GRID_ALIGN_START and LV_GRID_ALIGN_END is swapped. I.e. START will mean right-most.
The columns will be placed from right to left.
|
|
Example
Demonstrate cell placement and span
Demonstrate grid's "free unit"
Demonstrate track placement
Demonstrate column and row gap
Demonstrate RTL direction on grid
英文
|
自動翻訳
|
A simple grid
|
|
|
|
|
|
|
API
英文
|
自動翻訳
|
Enums
- enum lv_grid_align_t
- Values:
- enumerator LV_GRID_ALIGN_START
- enumerator LV_GRID_ALIGN_CENTER
- enumerator LV_GRID_ALIGN_END
- enumerator LV_GRID_ALIGN_STRETCH
- enumerator LV_GRID_ALIGN_SPACE_EVENLY
- enumerator LV_GRID_ALIGN_SPACE_AROUND
- enumerator LV_GRID_ALIGN_SPACE_BETWEEN
Functions
- LV_EXPORT_CONST_INT(LV_GRID_CONTENT)
- LV_EXPORT_CONST_INT(LV_GRID_TEMPLATE_LAST)
- void lv_grid_init(void)
- void lv_obj_set_grid_dsc_array(lv_obj_t *obj, const lv_coord_t col_dsc[], const lv_coord_t row_dsc[])
- void lv_obj_set_grid_align(lv_obj_t *obj, lv_grid_align_t column_align, lv_grid_align_t row_align)
- void lv_obj_set_grid_cell(lv_obj_t *obj, lv_grid_align_t column_align, uint8_t col_pos, uint8_t col_span, lv_grid_align_t row_align, uint8_t row_pos, uint8_t row_span)
- Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen
- Parameters
-
- obj -- pointer to an object
- column_align -- the vertical alignment in the cell.
LV_GRID_START/END/CENTER/STRETCH
- col_pos -- column ID
- col_span -- number of columns to take (>= 1)
- row_align -- the horizontal alignment in the cell.
LV_GRID_START/END/CENTER/STRETCH
- row_pos -- row ID
- row_span -- number of rows to take (>= 1)
- static inline lv_coord_t lv_grid_fr(uint8_t x)
- Just a wrapper to
LV_GRID_FR for bindings.
- void lv_style_set_grid_row_dsc_array(lv_style_t *style, const lv_coord_t value[])
- void lv_style_set_grid_column_dsc_array(lv_style_t *style, const lv_coord_t value[])
- void lv_style_set_grid_row_align(lv_style_t *style, lv_grid_align_t value)
- void lv_style_set_grid_column_align(lv_style_t *style, lv_grid_align_t value)
- void lv_style_set_grid_cell_column_pos(lv_style_t *style, lv_coord_t value)
- void lv_style_set_grid_cell_column_span(lv_style_t *style, lv_coord_t value)
- void lv_style_set_grid_cell_row_pos(lv_style_t *style, lv_coord_t value)
- void lv_style_set_grid_cell_row_span(lv_style_t *style, lv_coord_t value)
- void lv_style_set_grid_cell_x_align(lv_style_t *style, lv_coord_t value)
- void lv_style_set_grid_cell_y_align(lv_style_t *style, lv_coord_t value)
- void lv_obj_set_style_grid_row_dsc_array(lv_obj_t *obj, const lv_coord_t value[], lv_style_selector_t selector)
- void lv_obj_set_style_grid_column_dsc_array(lv_obj_t *obj, const lv_coord_t value[], lv_style_selector_t selector)
- void lv_obj_set_style_grid_row_align(lv_obj_t *obj, lv_grid_align_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_column_align(lv_obj_t *obj, lv_grid_align_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_cell_column_pos(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_cell_column_span(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_cell_row_pos(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_cell_row_span(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_cell_x_align(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector)
- void lv_obj_set_style_grid_cell_y_align(lv_obj_t *obj, lv_coord_t value, lv_style_selector_t selector)
- static inline const lv_coord_t *lv_obj_get_style_grid_row_dsc_array(const lv_obj_t *obj, uint32_t part)
- static inline const lv_coord_t *lv_obj_get_style_grid_column_dsc_array(const lv_obj_t *obj, uint32_t part)
- static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const lv_obj_t *obj, uint32_t part)
- static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const lv_obj_t *obj, uint32_t part)
- static inline lv_coord_t lv_obj_get_style_grid_cell_column_pos(const lv_obj_t *obj, uint32_t part)
- static inline lv_coord_t lv_obj_get_style_grid_cell_column_span(const lv_obj_t *obj, uint32_t part)
- static inline lv_coord_t lv_obj_get_style_grid_cell_row_pos(const lv_obj_t *obj, uint32_t part)
- static inline lv_coord_t lv_obj_get_style_grid_cell_row_span(const lv_obj_t *obj, uint32_t part)
- static inline lv_coord_t lv_obj_get_style_grid_cell_x_align(const lv_obj_t *obj, uint32_t part)
- static inline lv_coord_t lv_obj_get_style_grid_cell_y_align(const lv_obj_t *obj, uint32_t part)
Variables
- uint32_t LV_LAYOUT_GRID
- lv_style_prop_t LV_STYLE_GRID_COLUMN_DSC_ARRAY
- lv_style_prop_t LV_STYLE_GRID_COLUMN_ALIGN
- lv_style_prop_t LV_STYLE_GRID_ROW_DSC_ARRAY
- lv_style_prop_t LV_STYLE_GRID_ROW_ALIGN
- lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_POS
- lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_SPAN
- lv_style_prop_t LV_STYLE_GRID_CELL_X_ALIGN
- lv_style_prop_t LV_STYLE_GRID_CELL_ROW_POS
- lv_style_prop_t LV_STYLE_GRID_CELL_ROW_SPAN
- lv_style_prop_t LV_STYLE_GRID_CELL_Y_ALIGN
|
|
- 戻る : Previous
|