I'm trying to position a StackLayout to the bottom of the page using an AbsoluteLayout as demonstrated in below code sample. However the position flag is treated as absolute value not proportional resulting in having the StackLayout positioned in the top of the page (rather in the bottom). When I inclemently increase the position value, the StackLayout starts to shift downward which it should not since the the layoutFlags are set to "All". Any help would be appreciated in help to resolve this issue, is it a bug in .net MAUI?
<AbsoluteLayout Margin="5">
<StackLayout BackgroundColor="White"
AbsoluteLayout.LayoutBounds="0,1,1,0.2"
AbsoluteLayout.LayoutFlags="All">
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="التاريخ المحدد:"/>
<Label x:Name="selectedDeliveryDate"/>
</StackLayout>
<Button x:Name="confirmDateSelected" Text="تأكيد" BackgroundColor="#009688" Margin="20,5,20,5" Clicked="confirmDateSelected_Clicked"/>
</StackLayout>
</AbsoluteLayout>
It works for me.
The problem is something you don't show:
What did you place <AbsoluteLayout ...
inside of?
The proportions of AbsoluteLayout are relative to whatever layout it is inside of.
Here I've taken your code, but changed background color to "Red", and placed it directly inside a page:
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="MauiApp7t.Page3"
Title="Page3">
<AbsoluteLayout Margin="5">
<StackLayout BackgroundColor="Red"
AbsoluteLayout.LayoutBounds="0,1,1,0.2"
AbsoluteLayout.LayoutFlags="All">
<StackLayout Orientation="Horizontal" HorizontalOptions="Center">
<Label Text="التاريخ المحدد:"/>
<Label x:Name="selectedDeliveryDate"/>
</StackLayout>
</StackLayout>
</AbsoluteLayout>
</ContentPage>
This does what you describe: My "red" area is at bottom of screen:
Tested on both Windows and Android.
Tested both as a stand-alone page, and as a page within AppShell.