https://docs.lvgl.io/latest/en/html/widgets/cont.html
Container (lv_cont)
Overview
英文
|
自動翻訳
|
The containers are essentially a basic object with layout and automatic sizing features.
|
コンテナは、基本的にレイアウトと自動サイジング機能を備えた基本オブジェクトです。
|
- 戻る : Previous
Parts and Styles
英文
|
自動翻訳
|
The containers has only a main style called LV_CONT_PART_MAIN and it can use all the typicaly bacground properties and padding for layout auto sizing.
|
コンテナには、LV_CONT_PART_MAIN と呼ばれるメインスタイルのみがあり、レイアウトオートサイジングにはすべての典型的なバクグラウンドプロパティとパディングを使用できます。
|
- 戻る : Previous
Usage
Layout
英文
|
自動翻訳
|
You can apply a layout on the containers to automatically order their children.
The layout spacing comes from the style's pad properties. The possible layout options:
- LV_LAYOUT_OFF - Do not align the children.
- LV_LAYOUT_CENTER - Align children to the center in column and keep
pad_inner space between them.
- LV_LAYOUT_COLUMN_LEFT - Align children in a left-justified column. Keep
pad_left space on the left, pad_top space on the top and pad_inner space between the children.
- LV_LAYOUT_COLUMN_MID - Align children in centered column. Keep
pad_top space on the top and pad_inner space between the children.
- LV_LAYOUT_COLUMN_RIGHT - Align children in a right-justified column. Keep
pad_right space on the right, pad_top space on the top and pad_inner space between the children.
- LV_LAYOUT_ROW_TOP - Align children in a top justified row. Keep
pad_left space on the left, pad_top space on the top and pad_inner space between the children.
- LV_LAYOUT_ROW_MID - Align children in centered row. Keep
pad_left space on the left and pad_inner space between the children.
|
コンテナにレイアウトを適用して、子供を自動的に注文できます。
レイアウト間隔は、スタイルのpad プロパティに由来します。可能なレイアウトオプション:
- LV_LAYOUT_OFF-子供を調整しないでください。
- LV_LAYOUT_CENTER-子供を列の中央に並べ、それらの間に
pad_inner スペースを保持します。
- LV_LAYOUT_COLUMN_LEFT-左正当化された列に子供を調整します。左側に
pad_left スペース、上部のpad_top スペース、子供の間のpad_inner スペースを保持します。
- LV_LAYOUT_COLUMN_MID-中央の列に子供を整列させます。上部に
pad_top スペースを保ち、子供の間のpad_inner スペースを保持します。
- LV_LAYOUT_COLUMN_RIGHT-右正当化された列に子供を調整します。右側に
pad_right スペース、上部のpad_top スペース、子供の間のpad_inner スペースを保持します。
- LV_LAYOUT_ROW_TOP-子どもを一番正当な列に合わせます。左側に
pad_left スペース、上部のpad_top スペース、子供の間のpad_inner スペースを保持します。
- LV_LAYOUT_ROW_MID-中央の列に子供を調整します。左側に
pad_left スペースを保持し、子供の間のpad_inner スペースを保持します。
|
- LV_LAYOUT_ROW_BOTTOM - Align children in a bottom justified row. Keep
pad_left space on the left, pad_bottom space on the bottom and pad_inner space between the children.
- LV_LAYOUT_PRETTY_TOP - Put as many objects as possible in a row (with at least
pad_inner space and pad_left/right space on the sides). Divide the space in each line equally between the children. If here are children with different height in a row align their top edge.
- LV_LAYOUT_PRETTY_MID - Same as
LV_LAYOUT_PRETTY_TOP but if here are children with different height in a row align their middle line.
- LV_LAYOUT_PRETTY_BOTTOM - Same as
LV_LAYOUT_PRETTY_TOP but if here are children with different height in a row align their bottom line.
- LV_LAYOUT_GRID - Similar to
LV_LAYOUT_PRETTY but not divide horizontal space equally just let pad_left/right on the edges and pad_inner space between the elements.
|
- LV_LAYOUT_ROW_BOTTOM-下部の正当な列に子供を並べます。左側に
pad_left スペース、底部にpad_bottom スペース、子供の間のpad_inner スペースを保持します。
- LV_LAYOUT_PRETTY_TOP-できるだけ多くのオブジェクトを連続して配置します(少なくとも
pad_inner スペースと側面にPAD_LEFT/右スペースがあります)。各ラインのスペースを子供の間で均等に分割します。ここに連続して身長が異なる子供が最上端を合わせている場合。
- LV_LAYOUT_PRETTY_MID-
LV_LAYOUT_PRETTY_TOP と同じですが、ここに連続してさまざまな高さの子供が中央の線を合わせます。
- LV_LAYOUT_PRETTY_BOTTOM-
LV_LAYOUT_PRETTY_TOP と同じですが、ここに連続してさまざまな高さの子供が最終的な線に合わせてください。
- LV_LAYOUT_GRID -
LV_LAYOUT_PRETTY と似ていますが、水平方向のスペースを均等に分割せず、エッジに pad_left/right を、要素間に pad_inner スペースを設定します。
|
- 戻る : Previous
Autofit
英文
|
自動翻訳
|
Container have an autofit feature which can automatically change the size of the container according to its children and/or its parent.
The following options exist:
- LV_FIT_NONE - Do not change the size automatically.
- LV_FIT_TIGHT - Shrink-wrap the container around all of its children, while keeping
pad_top/bottom/left/right space on the edges.
- LV_FIT_PARENT - Set the size to the parent's size minus
pad_top/bottom/left/right (from the parent's style) space.
- LV_FIT_MAX - Use
LV_FIT_PARENT while smaller than the parent and LV_FIT_TIGHT when larger. It will ensure that the container is, at minimum, the size of its parent.
To set the auto fit mode for all directions, use lv_cont_set_fit(cont, LV_FIT_...) .
To use different auto fit horizontally and vertically, use lv_cont_set_fit2(cont, hor_fit_type, ver_fit_type) . To use different auto fit in all 4 directions, use lv_cont_set_fit4(cont, left_fit_type, right_fit_type, top_fit_type, bottom_fit_type) .
|
コンテナには、子や親に応じてコンテナのサイズを自動的に変更できるオートフィット機能があります。
次のオプションが存在します:
- LV_FIT_NONE-サイズを自動的に変更しないでください。
- LV_FIT_TIGHT-すべての子の周りにコンテナを縮小します。
- LV_FIT_PARENT-サイズを親のサイズにマイナスpad_top/bottom/左/右(親のスタイルから)に設定します。
- LV_FIT_MAX -lv_fit_parentを使用して、親よりも小さく、lv_fit_tightが大きいときは使用します。 コンテナが少なくともその親のサイズであることを保証します。
すべての方向に自動フィットモードを設定するには、lv_cont_set_fit(cont、lv_fit _...)を使用します。
さまざまな自動適合を水平および垂直に使用するには、lv_cont_set_fit2(cont、hor_fit_type、ver_fit_type)を使用します。 4つの方向すべてで異なるオートフィットを使用するには、lv_cont_set_fit4(cont、left_fit_type、right_fit_type、top_fit_type、botond_fit_type)を使用します。
|
- 戻る : Previous
Events
- 戻る : Previous
Keys
英文
|
自動翻訳
|
No Keys are processed by the object type.
Learn more about Keys.
|
オブジェクトタイプで処理されるキーはありません。
キーの詳細をご覧ください。
|
- 戻る : Previous
Example
Container with auto-fit
- 戻る : Previous
- 戻る : Previous