Welcome to the Xamarin.Forms feedback portal. We’re happy you’re here! If you have feedback on how to improve the Xamarin.Forms, we’d love to hear it!

  • Check out the features or bugs others have reported and vote on your favorites. Feedback will be prioritized based on popularity.
  • If you have feedback that’s not listed yet, submit your own.

Thanks for joining our community and helping improve Syncfusion products!

1
Vote

Hi,

I generated gradient stop color in code behind, but on ios simulator didn't work.


xcode: 13.4.1

ios: 15.5

vs22 for mac: 17.3.1 (build 411)

Here is my code:

GaugeGradientStop gaugeGradientStop = new GaugeGradientStop();

gaugeGradientStop.Value = LinearScaleGauge.MaximumValue - _plusMaximumValue;

gaugeGradientStop.Color = Color.FromHex("#cc2f2f");

BarPointerGauge.GradientStops.Add(gaugeGradientStop);


gaugeGradientStop = new GaugeGradientStop();

gaugeGradientStop.Value = LinearScaleGauge.MaximumValue - _plusMaximumValue;

gaugeGradientStop.Color = Color.FromHex("#27a76b");

BarPointerGauge.GradientStops.Add(gaugeGradientStop);


Error message:

Could not initialize an instance of the type 'CoreGraphics.CGGradient': handle is null.

It is possible to ignore this condition by setting ObjCRuntime.Class.ThrowOnInitFailure to false.


Stack Trace:

  at ObjCRuntime.DisposableObject.InitializeHandle (System.IntPtr handle, System.Boolean verify) [0x00017] in /Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/src/Xamarin.iOS/ObjCRuntime/DisposableObject.cs:81

  at ObjCRuntime.DisposableObject..ctor (System.IntPtr handle, System.Boolean owns, System.Boolean verify) [0x00006] in /Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/src/Xamarin.iOS/ObjCRuntime/DisposableObject.cs:51

  at CoreFoundation.NativeObject..ctor (System.IntPtr handle, System.Boolean owns, System.Boolean verify) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/src/Xamarin.iOS/CoreFoundation/NativeObject.cs:53

  at CoreFoundation.NativeObject..ctor (System.IntPtr handle, System.Boolean owns) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/src/Xamarin.iOS/CoreFoundation/NativeObject.cs:48

  at CoreGraphics.CGGradient..ctor (CoreGraphics.CGColorSpace colorspace, CoreGraphics.CGColor[] colors, System.nfloat[] locations) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/src/Xamarin.iOS/CoreGraphics/CGGradient.cs:140

  at Syncfusion.SfGauge.iOS.SFBarPointer.DrawInContext (CoreGraphics.CGContext ctx) [0x004d3] in <863d22d0e2cd424fbe2e20fab591bfc7>:0

  at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)

  at UIKit.UIApplication.Main (System.String[] args, System.Type principalClass, System.Type delegateClass) [0x0003b] in /Library/Frameworks/Xamarin.iOS.framework/Versions/15.12.0.2/src/Xamarin.iOS/UIKit/UIApplication.cs:85

  at MySignoX.iOS.Application.Main (System.String[] args) [0x00002] in /Users/bsuranyi/Dokumentumok/Projects/mySignoX/MySignoX.iOS/Main.cs:14