AbsoluteLayout not present on latest nventive UNO?
This code in the xaml file, render's nothing: Please suggest as what to use to position the controls absolutely on the page.
<Grid x:Name="gd"> <Canvas Width="{Binding ElementName=gd, Path=ActualWidth}" Height="{Binding ElementName=gd, Path=ActualHeight}"> <Grid Canvas.Left="0" Canvas.Top="100"> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Rectangle Fill="Red" /> <Rectangle Fill="Black" /> </Grid> </Canvas> </Grid>
AbsoluteLayout
is a naming coming from Xamarin.Forms/MAUI. In the WPF/WinUI/UWP XAML, the analogous layout panel is called Canvas
.
You can layout its children by setting the Canvas.Left
and Canvas.Top
properties:
<Canvas Width="400" Height="400">
<Button
Canvas.Left="100" Canvas.Top="50"
Width="100" Height="100" Background="Red" />
<Border
Canvas.Left="20" Canvas.Top="200"
Width="50" Height="50" Background="Blue" />
</Canvas>