1 August 2022

HorizontalStackLayout in MAUI

 In this example we are going to see HorizontalStackLayout Example in MAUI.

1) Add new page and Update code as below.

<?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="MauiApp1.HorizontalStackLayoutEXP1"

             Title="HorizontalStackLayoutEXP1">

    <HorizontalStackLayout Spacing="10" >

        <Label 

            Text="HorizontalStackLayout "

            VerticalOptions="Center" 

            HorizontalOptions="Start"  ></Label>

        <Label 

            Text="HorizontalStackLayout EXP1"

            VerticalOptions="Center" 

            HorizontalOptions="Center" BackgroundColor="Red" />

        <Label 

            Text="HorizontalStackLayout EXP1"

            VerticalOptions="Center" 

            HorizontalOptions="Center" BackgroundColor="Yellow" />

        <Label 

            Text="HorizontalStackLayout EXP1"

            VerticalOptions="Center" 

            HorizontalOptions="Center" BackgroundColor="Brown" />

    </HorizontalStackLayout>

</ContentPage>

Output:




Code in Github: https://github.com/adi501/MAUI

No comments:

Post a Comment