container (package)
import "fyne.io/fyne/v2/container"Package container provides containers that are used to lay out and organise applications.
Usage
const (
// ScrollBoth supports horizontal and vertical scrolling.
ScrollBoth ScrollDirection = fyne.ScrollBoth
// ScrollHorizontalOnly specifies the scrolling should only happen left to right.
ScrollHorizontalOnly = fyne.ScrollHorizontalOnly
// ScrollVerticalOnly specifies the scrolling should only happen top to bottom.
ScrollVerticalOnly = fyne.ScrollVerticalOnly
// ScrollNone turns off scrolling for this container.
//
// Since: 2.1
ScrollNone = fyne.ScrollNone
)Constants for valid values of ScrollDirection.
func New
func New(layout fyne.Layout, objects ...fyne.CanvasObject) *fyne.ContainerNew returns a new Container instance holding the specified CanvasObjects which will be laid out according to the specified Layout.
2.0func NewAdaptiveGrid
func NewAdaptiveGrid(rowcols int, objects ...fyne.CanvasObject) *fyne.ContainerNewAdaptiveGrid creates a new container with the specified objects and using the grid layout. When in a horizontal arrangement the rowcols parameter will specify the column count, when in vertical it will specify the rows. On mobile this will dynamically refresh when device is rotated.
1.4func NewBorder
func NewBorder(top, bottom, left, right fyne.CanvasObject, objects ...fyne.CanvasObject) *fyne.ContainerNewBorder creates a new container with the specified objects and using the border layout. The top, bottom, left and right parameters specify the items that should be placed around edges. Nil can be used to an edge if it should not be filled. Passed objects not assigned to any edge (parameters 5 onwards) will be used to fill the space remaining in the middle. Parameters 6 onwards will be stacked over the middle content in the specified order as a Stack container.
1.4func NewCenter
func NewCenter(objects ...fyne.CanvasObject) *fyne.ContainerNewCenter creates a new container with the specified objects centered in the available space.
1.4func NewGridWithColumns
func NewGridWithColumns(cols int, objects ...fyne.CanvasObject) *fyne.ContainerNewGridWithColumns creates a new container with the specified objects and using the grid layout with a specified number of columns. The number of rows will depend on how many children are in the container.
1.4func NewGridWithRows
func NewGridWithRows(rows int, objects ...fyne.CanvasObject) *fyne.ContainerNewGridWithRows creates a new container with the specified objects and using the grid layout with a specified number of rows. The number of columns will depend on how many children are in the container.
1.4func NewGridWrap
func NewGridWrap(size fyne.Size, objects ...fyne.CanvasObject) *fyne.ContainerNewGridWrap creates a new container with the specified objects and using the gridwrap layout. Every element will be resized to the size parameter and the content will arrange along a row and flow to a new row if the elements don’t fit.
1.4func NewHBox
func NewHBox(objects ...fyne.CanvasObject) *fyne.ContainerNewHBox creates a new container with the specified objects and using the HBox layout. The objects will be placed in the container from left to right and always displayed at their horizontal MinSize. Use a different layout if the objects are intended to be larger then their horizontal MinSize.
1.4func NewMax
func NewMax(objects ...fyne.CanvasObject) *fyne.ContainerNewMax creates a new container with the specified objects filling the available space.
1.4func NewPadded
func NewPadded(objects ...fyne.CanvasObject) *fyne.ContainerNewPadded creates a new container with the specified objects inset by standard padding size.
1.4func NewStack
func NewStack(objects ...fyne.CanvasObject) *fyne.ContainerNewStack returns a new container that stacks objects on top of each other. Objects at the end of the container will be stacked on top of objects before. Having only a single object has no impact as CanvasObjects will fill the available space even without a Stack.
2.4func NewVBox
func NewVBox(objects ...fyne.CanvasObject) *fyne.ContainerNewVBox creates a new container with the specified objects and using the VBox layout. The objects will be stacked in the container from top to bottom and always displayed at their vertical MinSize. Use a different layout if the objects are intended to be larger then their vertical MinSize.
1.4func NewWithoutLayout
func NewWithoutLayout(objects ...fyne.CanvasObject) *fyne.ContainerNewWithoutLayout returns a new Container instance holding the specified CanvasObjects that are manually arranged.
2.0