「App:Library:LVGL:docs:Layouts:Grid」の版間の差分
17行目: | 17行目: | ||
|- | |- | ||
| | | | ||
− | The Grid layout is a subset of CSS Flexbox. | + | The Grid layout is a subset of [https://css-tricks.com/snippets/css/complete-guide-grid/ '''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 (<code style="color: #bb0000;">LV_GRID_CONTENT</code>) or in "Free unit" (FR) to distribute the free space proportionally. | 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 (<code style="color: #bb0000;">LV_GRID_CONTENT</code>) or in "Free unit" (FR) to distribute the free space proportionally. | ||
251行目: | 251行目: | ||
: Just a wrapper to <code style="color: #bb0000;">LV_GRID_FR</code> for bindings. | : Just a wrapper to <code style="color: #bb0000;">LV_GRID_FR</code> for bindings. | ||
− | ; void lv_style_set_grid_row_dsc_array(lv_style_t *style, const lv_coord_t value[]) | + | ; void lv_style_set_grid_row_dsc_array([https://docs.lvgl.io/8.2/overview/style.html#_CPPv410lv_style_t '''lv_style_t'''] *style, const lv_coord_t value[]) |
: | : | ||
381行目: | 381行目: | ||
:[[App:Library:LVGL#Widgets|戻る : Previous]] | :[[App:Library:LVGL#Widgets|戻る : Previous]] | ||
+ | |} |
2022年6月28日 (火) 15:21時点における版
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
|