Skip to content

Instantly share code, notes, and snippets.

@vhugogarcia
Created November 28, 2022 17:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vhugogarcia/b49af71df1e339626f758479d836b45a to your computer and use it in GitHub Desktop.
Save vhugogarcia/b49af71df1e339626f758479d836b45a to your computer and use it in GitHub Desktop.
Set gradient background to content page in .NET MAUI
<?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"
xmlns:ios="clr-namespace:Microsoft.Maui.Controls.PlatformConfiguration.iOSSpecific;assembly=Microsoft.Maui.Controls"
ios:Page.UseSafeArea="False">
<FlexLayout Direction="Column"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand">
<FlexLayout.Background>
<LinearGradientBrush EndPoint="0,1">
<GradientStop Color="{StaticResource Primary}"
Offset="0.1" />
<GradientStop Color="{StaticResource PrimaryAlt}"
Offset="1.0" />
</LinearGradientBrush>
</FlexLayout.Background>
<!-- Content Goes here -->
</FlexLayout>
</ContentPage>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment