Gradient Xamarin Forms

Asked

Viewed 301 times

0

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

1 answer

1

You can use a ready-made 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>




inserir a descrição da imagem aqui

Browser other questions tagged

You are not signed in. Login or sign up in order to post.