Gradient Xamarin Forms

0

I'm doing the screens of a Xamarin app with XAML, and wanted to put a gradient background is it possible? For now the code is this:

                                   

    
asked by anonymous 16.05.2017 / 21:30

1 answer

1

You can use a ready component:

Git: XFGloss: Xamarin.Forms UI Enhancements
Nuget: XFGloss for Xamarin.Forms

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:xfg="clr-namespace:XFGloss;assembly=XFGloss"
             x:Class="XFGlossSample.Views.AboutPage"
             Title="XFGloss Sample App" Padding="10">

    <xfg:ContentPageGloss.BackgroundGradient>
        <xfg:Gradient Rotation="150">
            <xfg:GradientStep StepColor="White" StepPercentage="0" />
            <xfg:GradientStep StepColor="White" StepPercentage=".5" />
            <xfg:GradientStep StepColor="#ccd9ff" StepPercentage="1" />
        </xfg:Gradient>
    </xfg:ContentPageGloss.BackgroundGradient>
    ...
</ContentPage>




    
08.06.2017 / 16:24