Skip to content

Instantly share code, notes, and snippets.

@tj-devel709
Created April 16, 2024 15:07
<ContentPage
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Maui.Controls.Sample.MainPage"
xmlns:local="clr-namespace:Maui.Controls.Sample">
<ScrollView>
<VerticalStackLayout Margin="0,10,0,0" Grid.RowSpan="2">
<Label Text="Image on bottom with spacing of 20" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot.png"
Text="Button 1"
ContentLayout="Bottom, 20"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Image on top with spacing of 20, padding of 10, long text, HeightRequest of 100, and WidthRequest of 200" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot.png"
Text="Button 2 with a super duper extremely very long super duper extremely very long super duper extremely very long text box"
ContentLayout="Top, 20"
Padding="10"
LineBreakMode="TailTruncation"
HeightRequest="100"
WidthRequest="200"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Image on left with spacing of 20, long text, and WidthRequest of 200" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot.png"
Text="Button 3 with a super duper extremely very long super duper extremely very long super duper extremely very long text box"
ContentLayout="Left, 20"
LineBreakMode="TailTruncation"
WidthRequest="200"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Image on right with spacing of 20 and padding of 20" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot.png"
Text="Button 4"
Padding="20"
ContentLayout="Right, 20"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Image on left with spacing of 0 and padding of 0" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot.png"
Text="Button 5"
Padding="0"
ContentLayout="Left, 0"
Background="LightGray"/>
<BoxView HeightRequest="100"/>
<Label Text="Now using smaller images (25x25)" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Background="LightBlue" HeightRequest="50"/>
<BoxView HeightRequest="100"/>
<Label Text="Small image on bottom with spacing of 20" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot_resized.png"
Text="Button 1_1"
ContentLayout="Bottom, 20"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Small image on top with spacing of 20, padding of 10, long text, HeightRequest of 100, and WidthRequest of 200" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot_resized.png"
Text="Button 2_1 with a super duper extremely very long super duper extremely very long super duper extremely very long text box"
ContentLayout="Top, 20"
Padding="10"
LineBreakMode="TailTruncation"
HeightRequest="100"
WidthRequest="200"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Small image on left with spacing of 20, long text, and WidthRequest of 200" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot_resized.png"
Text="Button 3_1 with a super duper extremely very long super duper extremely very long super duper extremely very long text box"
ContentLayout="Left, 20"
LineBreakMode="TailTruncation"
WidthRequest="200"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Small image on right with spacing of 20 and padding of 20" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot_resized.png"
Text="Button 4_1"
Padding="20"
ContentLayout="Right, 20"
Background="LightGray"/>
<BoxView HeightRequest="30"/>
<Label Text="Small image on left with spacing of 0 and padding of 0" HorizontalTextAlignment="Center" LineBreakMode="WordWrap" />
<Button ImageSource="dotnet_bot_resized.png"
Text="Button 5_1"
Padding="0"
ContentLayout="Left, 0"
Background="LightGray"/>
</VerticalStackLayout>
</ScrollView>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment