layout (package)
import "fyne.io/fyne/v2/layout"Package layout defines the various layouts available to Fyne apps.
Usage
func NewAdaptiveGridLayout
func NewAdaptiveGridLayout(rowcols int) fyne.LayoutNewAdaptiveGridLayout returns a new grid layout which uses columns when horizontal but rows when vertical.
func NewBorderLayout
func NewBorderLayout(top, bottom, left, right fyne.CanvasObject) fyne.LayoutNewBorderLayout creates a new BorderLayout instance with top, bottom, left and right objects set. All other items in the container will fill the remaining space in the middle. Multiple extra items will be stacked in the specified order as a Stack container.
func NewCenterLayout
func NewCenterLayout() fyne.LayoutNewCenterLayout creates a new CenterLayout instance
func NewCustomPaddedHBoxLayout
func NewCustomPaddedHBoxLayout(padding float32) fyne.LayoutNewCustomPaddedHBoxLayout returns a layout similar to HBoxLayout that uses a custom amount of padding in between objects instead of the theme.Padding value.
2.5func NewCustomPaddedLayout
func NewCustomPaddedLayout(padTop, padBottom, padLeft, padRight float32) fyne.LayoutNewCustomPaddedLayout creates a new CustomPaddedLayout instance with the specified paddings.
2.5func NewCustomPaddedVBoxLayout
func NewCustomPaddedVBoxLayout(padding float32) fyne.LayoutNewCustomPaddedVBoxLayout returns a layout similar to VBoxLayout that uses a custom amount of padding in between objects instead of the theme.Padding value.
2.5func NewFormLayout
func NewFormLayout() fyne.LayoutNewFormLayout returns a new FormLayout instance
func NewGridLayout
func NewGridLayout(cols int) fyne.LayoutNewGridLayout returns a grid layout arranged in a specified number of columns. The number of rows will depend on how many children are in the container that uses this layout.
func NewGridLayoutWithColumns
func NewGridLayoutWithColumns(cols int) fyne.LayoutNewGridLayoutWithColumns returns a new grid layout that specifies a column count and wrap to new rows when needed.
func NewGridLayoutWithRows
func NewGridLayoutWithRows(rows int) fyne.LayoutNewGridLayoutWithRows returns a new grid layout that specifies a row count that creates new rows as required.
func NewGridWrapLayout
func NewGridWrapLayout(size fyne.Size) fyne.LayoutNewGridWrapLayout returns a new GridWrapLayout instance
func NewHBoxLayout
func NewHBoxLayout() fyne.LayoutNewHBoxLayout returns a horizontal box layout for stacking a number of child canvas objects or widgets left to right. The objects are always displayed at their horizontal MinSize. Use a different layout if the objects are intended to be larger than their horizontal MinSize.
func NewMaxLayout
func NewMaxLayout() fyne.LayoutNewMaxLayout creates a new MaxLayout instance
func NewPaddedLayout
func NewPaddedLayout() fyne.LayoutNewPaddedLayout creates a new PaddedLayout instance
1.4func NewRowWrapLayout
func NewRowWrapLayout() fyne.LayoutNewRowWrapLayout returns a layout that dynamically arranges objects of similar height in rows and wraps them dynamically. Objects are separated with horizontal and vertical padding.
2.7func NewRowWrapLayoutWithCustomPadding
func NewRowWrapLayoutWithCustomPadding(horizontal, vertical float32) fyne.LayoutNewRowWrapLayoutWithCustomPadding returns a new RowWrapLayout instance with custom horizontal and inner padding.
2.7func NewSpacer
func NewSpacer() fyne.CanvasObjectNewSpacer returns a spacer object which can fill vertical and horizontal space. This is primarily used with a box layout.
func NewStackLayout
func NewStackLayout() fyne.LayoutNewStackLayout returns a new StackLayout instance. Objects are stacked on top of each other with later objects on top of those before. Having only a single object has no impact as CanvasObjects will fill the available space even without a Stack.
2.4func NewVBoxLayout
func NewVBoxLayout() fyne.LayoutNewVBoxLayout returns a vertical box layout for stacking a number of child canvas objects or widgets top to bottom. The objects are always displayed at their vertical MinSize. Use a different layout if the objects are intended to be larger than their vertical MinSize.