Home > OS >  C# Xamarin Shell
C# Xamarin Shell

Time:08-08

Code

<Shell.Background>
    <LinearGradientBrush.... 
</Shell.Background>

don't work. But code

<Shell.... 
BackgroundColor="#00FFBB">

Is working, but color is darker than real "#00FFBB". How to fix it?

CodePudding user response:

I firstly suggest reading this question, if this doesn't correct your problem you could play with color luminosity (or brightness) as shown here; to modify your Shell color brightness I suggest you change it using code

Example:

var colorMain = Color.FromHex("#00FFBB"); //Your color
colorMain = colorMain.WithLuminosity((float)(colorMain.GetLuminosity() * 1.1)); //Make it brighter

Shell.SetBackgroundColor(Shell.Current, colorMain); //Setting brighter color to the Shell

CodePudding user response:

In fact, I can replicate the issue on my side and there's an open issue about Shell.Background not displaying gradient Brush on Github.

You can follow it up here:https://github.com/xamarin/Xamarin.Forms/issues/13066.

  • Related