AbsoluteLayout

An AbsoluteLayout positions and sizes children using absolute device-independent values.

Example

In the example below, the first two numbers is the X and Y position of the BoxView relative with respect to the Top Left corner. The next two numbers is the Width and Height of the BoxView.


        <AbsoluteLayout>
            <BoxView Color="Blue"
                        AbsoluteLayout.LayoutBounds="100, 50, 150, 200" />
        </AbsoluteLayout>
            

Microsoft Website contains the following warning:

Using absolute values for positioning and sizing children can be problematic, because different devices have different screen sizes and resolutions. Therefore, the coordinates for the center of the screen on one device may be offset on other devices.

Download

.NET MAUI