1

I have tried with Linear Gradient for Xamarin.Android and Xamarin.iOS and in iOS the start color[ Color.Blue ] is mixing with end color[ Color.Yellow ].[ See below image(Ending Color is mixed with blue)]. But in Android start color is Exact Blue and end Color is Exact Yellow. I need android requirement in iOS too. Am i miss anything in the below code for gradient

var colors = new CGColor[]

{
     UIColor.Blue.CGColor,
     UIColor.Yellow.CGColor 
};

var colorSpace = CGColorSpace.CreateDeviceRGB();

CGGradient gradient = new CGGradient(colorSpace, colors, null);

ctx.DrawLinearGradient(gradient, Start(bounds), End(bounds), CGGradientDrawingOptions.None);

iOS image:

iOS image

Android image:

Android image

yuvaraj
  • 56
  • 5
  • You want a conical gradient, you are drawing a boxed/square linear gradient: https://stackoverflow.com/a/24005813/4984832 – SushiHangover Dec 22 '17 at 21:15

0 Answers0