■ Border 엘리먼트를 사용해 제목을 장식하는 방법을 보여준다.
▶ MainPage.xaml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
<?xml version="1.0" encoding="utf-8" ?> <ContentPage x:Class="TestProject.MainPage" xmlns="http://schemas.microsoft.com/dotnet/2021/maui" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"> <ContentPage.Resources> <LinearGradientBrush x:Key="BorderBackgroundLinearGradientBrushKey" EndPoint="0,1"> <GradientStop Offset="0.1" Color="DarkGreen" /> <GradientStop Offset="1.0" Color="LightGreen" /> </LinearGradientBrush> <Shadow x:Key="BorderShadowKey" Offset="10,10" Radius="20" Opacity="1"> <Shadow.Brush> <LinearGradientBrush> <GradientStop Offset="0.1" Color="LightGray" /> <GradientStop Offset="1.0" Color="Gray" /> </LinearGradientBrush> </Shadow.Brush> </Shadow> <Shadow x:Key="LabelShadowKey" Offset="10,10" Radius="10" Opacity="1"> <Shadow.Brush> <LinearGradientBrush> <GradientStop Offset="0.1" Color="Black" /> <GradientStop Offset="1.0" Color="Gray" /> </LinearGradientBrush> </Shadow.Brush> </Shadow> </ContentPage.Resources> <StackLayout HorizontalOptions="Center" VerticalOptions="Center" Spacing="10"> <Grid Margin="10"> <Border StrokeThickness="0" Background="{StaticResource BorderBackgroundLinearGradientBrushKey}" Shadow="{StaticResource BorderShadowKey}"> <Border.StrokeShape> <RoundRectangle CornerRadius="0,50,0,50" /> </Border.StrokeShape> </Border> <Label HorizontalOptions="Center" VerticalOptions="Center" Padding="10" Shadow="{StaticResource LabelShadowKey}" FontSize="30" FontAttributes="Bold" TextColor="White" Text="MAUI" /> </Grid> <Grid Margin="10"> <Border StrokeThickness="0" Background="{StaticResource BorderBackgroundLinearGradientBrushKey}" Shadow="{StaticResource BorderShadowKey}"> <Border.StrokeShape> <RoundRectangle CornerRadius="0,0,50,50" /> </Border.StrokeShape> </Border> <Label HorizontalOptions="Center" VerticalOptions="Center" Padding="10" Shadow="{StaticResource LabelShadowKey}" FontSize="30" FontAttributes="Bold" TextColor="White" Text="MAUI" /> </Grid> <Grid Margin="10"> <Border StrokeThickness="0" Background="{StaticResource BorderBackgroundLinearGradientBrushKey}" Shadow="{StaticResource BorderShadowKey}"> <Border.StrokeShape> <RoundRectangle CornerRadius="50,50,50,50" /> </Border.StrokeShape> </Border> <Label HorizontalOptions="Center" VerticalOptions="Center" Padding="10" Shadow="{StaticResource LabelShadowKey}" FontSize="30" FontAttributes="Bold" TextColor="White" Text="MAUI" /> </Grid> </StackLayout> </ContentPage> |