Layout Options
Version:
v9.x
In FmgLib.MauiMarkup, you can layout every view in their container using the following extension methods:
CenterHorizontalCenterVerticalCenterAlignLeftAlignRightAlignTopAlignTopLeftAlignTopRightAlignBottomAlignBottomLeftAlignBottomRightFillHorizontallyFillVerticallyFillBothDirectionsAlignTopCenterAlignTopFillAlignBottomCenterAlignBottomFillAlignCenterLeftAlignCenterRightAlignCenterFillAlignFillLeftAlignFillRightAlignFillCenterAlignLayout
Usage
To use the layout options, create a container view , add the view you want to layout to the container, and call the desired method:
new StackLayout()
.Children(
new Label().Text("Hello, World!").Center()
)
This example centers a Label inside a StackLayout container. You can use the same method with other container views, and with any view that you want to lay out within its containing element.