When I leave my page, I use the OnDisappearing event to unload the PDF viewer control.
During this unload, I get an ArgumentNullException.
The error appears since versions 17.3.x.x
With version 17.2.0.51, I did not have a problem
Here is the stacktrace:
at UIKit.UIView.AddSubview (UIKit.UIView view) [0x00008] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIView.g.cs:268
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.RemoveIndicator () [0x00025] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.ScrollToHorizontalOffset (System.Double horizontalOffset) [0x00008] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at Syncfusion.SfPdfViewer.XForms.iOS.PdfViewerDependencyService.ScrollToHorizontalOffset (System.Single horizontalOffset, System.Object nativeObject) [0x00008] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at Syncfusion.SfPdfViewer.XForms.SfPdfViewer.set_HorizontalOffset (System.Single value) [0x00026] in :0
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.ScrollViewEx_Scrolled (System.Object sender, System.EventArgs e) [0x0040e] in <397ffd14fb724d0f887ac6b3c43e85e3>:0
at UIKit.UIScrollView+_UIScrollViewDelegate.Scrolled (UIKit.UIScrollView scrollView) [0x0000a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/13.4.0.2/src/Xamarin.iOS/UIScrollView.g.cs:1632
Here is the code that generates the exception:
protected override void OnDisappearing()
{
base.OnDisappearing();
pdfViewerControl.Unload();
}
Characteristic of the project:
Xamarin.Forms 4.2.0.848062
Xamarin.iOS 13.4.0.2
.NET STandard 2.1
Is there a workaround to correct this ?
Thanks.