「App:Library:LVGL:docs:Layouts:Grid」の版間の差分
(→API) |
|||
346行目: | 346行目: | ||
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_COLUMN_DSC_ARRAY | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_COLUMN_DSC_ARRAY |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_COLUMN_ALIGN | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_COLUMN_ALIGN |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_ROW_DSC_ARRAY | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_ROW_DSC_ARRAY |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_ROW_ALIGN | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_ROW_ALIGN |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_POS | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_CELL_COLUMN_POS |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_CELL_COLUMN_SPAN | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_CELL_COLUMN_SPAN |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_CELL_X_ALIGN | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_CELL_X_ALIGN |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_CELL_ROW_POS | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_CELL_ROW_POS |
: | : | ||
− | ; lv_style_prop_t LV_STYLE_GRID_CELL_ROW_SPAN | + | ; [https://docs.lvgl.io/8.2/overview/style.html#_CPPv415lv_style_prop_t '''lv_style_prop_t'''] LV_STYLE_GRID_CELL_ROW_SPAN |
: | : | ||
2022年6月28日 (火) 15:33時点における版
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
|