DEV Community

Cover image for Gradients in Xamarin.Forms
David Ortinau for .NET

Posted on

2 1

Gradients in Xamarin.Forms

Linear and radial gradient brushes, as well as solid brushes, can be used to paint backgrounds and other options in Xamarin.Forms. Here I use a linear brush to paint the background of a Frame container and a Button.

<Color x:Key="DarkBlue">#0091FF</Color>
<Color x:Key="LightBlue">#32C5FF</Color>
<LinearGradientBrush x:Key="BlueGradient" StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="{StaticResource DarkBlue}" Offset="0.5" />
<GradientStop Color="{StaticResource LightBlue}" Offset="1.0" />
</LinearGradientBrush>
view raw Gradients.xaml hosted with ❤ by GitHub

Resources:

GitHub logo davidortinau / PersonalFinanceSample

exploring Shapes and Gradients with Xamarin.Forms 4.8 pre-release




Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay