「App:Library:LVGL:docs:Layouts:Grid」の版間の差分
(→API) |
|||
203行目: | 203行目: | ||
Enums | Enums | ||
− | ; enum lv_grid_align_t | + | ; enum [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] |
: ''Values:'' | : ''Values:'' | ||
:; enumerator LV_GRID_ALIGN_START | :; enumerator LV_GRID_ALIGN_START | ||
234行目: | 234行目: | ||
: | : | ||
− | ; void lv_obj_set_grid_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t lv_grid_align_t] column_align, lv_grid_align_t row_align) | + | ; void lv_obj_set_grid_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] column_align, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] row_align) |
: | : | ||
− | ; void lv_obj_set_grid_cell([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''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) | + | ; void lv_obj_set_grid_cell([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] column_align, uint8_t col_pos, uint8_t col_span, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''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 | : Set the cell of an object. The object's parent needs to have grid layout, else nothing will happen | ||
:; Parameters | :; Parameters | ||
257行目: | 257行目: | ||
: | : | ||
− | ; void lv_style_set_grid_row_align([https://docs.lvgl.io/8.2/overview/style.html#_CPPv410lv_style_t '''lv_style_t'''] *style, lv_grid_align_t value) | + | ; void lv_style_set_grid_row_align([https://docs.lvgl.io/8.2/overview/style.html#_CPPv410lv_style_t '''lv_style_t'''] *style, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] value) |
: | : | ||
− | ; void lv_style_set_grid_column_align([https://docs.lvgl.io/8.2/overview/style.html#_CPPv410lv_style_t '''lv_style_t'''] *style, lv_grid_align_t value) | + | ; void lv_style_set_grid_column_align([https://docs.lvgl.io/8.2/overview/style.html#_CPPv410lv_style_t '''lv_style_t'''] *style, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] value) |
: | : | ||
287行目: | 287行目: | ||
: | : | ||
− | ; void lv_obj_set_style_grid_row_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_grid_align_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_row_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] value, lv_style_selector_t selector) |
: | : | ||
− | ; void lv_obj_set_style_grid_column_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, lv_grid_align_t value, lv_style_selector_t selector) | + | ; void lv_obj_set_style_grid_column_align([https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] value, lv_style_selector_t selector) |
: | : | ||
317行目: | 317行目: | ||
: | : | ||
− | ; static inline lv_grid_align_t lv_obj_get_style_grid_row_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) | + | ; static inline [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] lv_obj_get_style_grid_row_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
− | ; static inline lv_grid_align_t lv_obj_get_style_grid_column_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) | + | ; static inline [https://docs.lvgl.io/8.2/layouts/grid.html#_CPPv415lv_grid_align_t '''lv_grid_align_t'''] lv_obj_get_style_grid_column_align(const [https://docs.lvgl.io/8.2/widgets/obj.html#_CPPv48lv_obj_t '''lv_obj_t'''] *obj, uint32_t part) |
: | : | ||
2022年6月28日 (火) 15:30時点における版
https://docs.lvgl.io/8.2/widgets/index.html
英文 | 自動翻訳 |
---|---|
Grid
Overview
英文 | 自動翻訳 |
---|---|
The Grid layout is a subset of CSS Flexbox. It can arrange items into a 2D "table" that has rows or columns (tracks). The item can span through multiple columns or rows. The track's size can be set in pixel, to the largest item ( To make an object a grid container call Note that the grid layout feature of LVGL needs to be globally enabled with |
Terms
英文 | 自動翻訳 |
---|---|
|
Simple interface
英文 | 自動翻訳 |
---|---|
With the following functions you can easily set a Grid layout on any parent. |
Grid descriptors
英文 | 自動翻訳 |
---|---|
First you need to describe the size of rows and columns. It can be done by declaring 2 arrays and the track sizes in them. The last element must be For example: static lv_coord_t column_dsc[] = {100, 400, LV_GRID_TEMPLATE_LAST}; /*2 columns with 100 and 400 ps width*/ static lv_coord_t row_dsc[] = {100, 100, 100, LV_GRID_TEMPLATE_LAST}; /*3 100 px tall rows*/ To set the descriptors on a parent use Besides simple settings the size in pixel you can use two special values:
|
Grid items
英文 | 自動翻訳 |
---|---|
By default, the children are not added to the grid. They need to be added manually to a cell. To do this call
|
Grid align
英文 | 自動翻訳 |
---|---|
If there are some empty space the track can be aligned several ways:
To set the track's alignment use |
Style interface
英文 | 自動翻訳 |
---|---|
All the Grid related values are style properties under the hood and you can use them similarly to any other style properties. The following Grid related style properties exist:
|
Internal padding
英文 | 自動翻訳 | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
To modify the minimum space Grid inserts between objects, the following properties can be set on the Grid container style:
Other featuresRTL
ExampleDemonstrate cell placement and spanDemonstrate grid's "free unit"Demonstrate track placementDemonstrate column and row gapDemonstrate RTL direction on grid
API
|