ZXing.Net.Mobile崩溃应用程序

时间:2018-05-25 12:37:59

标签: c# xamarin.forms zxing.net

我在我的项目中使用ZXing.Net.Mobile.Forms。试过FreshMVVM和Prism。

ScannerXamlPage.xaml

<Grid>
    <zxing:ZXingScannerView x:Name="ScannerView"
        Result="{Binding ScanResult, Mode=OneWayToSource}"
        ScanResultCommand="{Binding ProcessBarcodeCommand}"
        IsScanning="{Binding IsScanning}"
        IsAnalyzing="{Binding IsAnalyzing}" />
    <zxing:ZXingDefaultOverlay x:Name="ScannerOverlay"
        TopText="Hold your phone up to the QR code"
        BottomText="Scanning will happen automatically"
        ShowFlashButton="True"/>

这导致RuntimeException: getParameters failed导航离开页面,然后返回到页面。 Related Github issue.

此解决方法暂时解决了这个问题:

protected override void OnDisappearing()
{
    base.OnDisappearing();
    Content = null;
}

0 个答案:

没有答案