0

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在离开页面然后返回页面时导致。相关的 Github 问题。

此解决方法现在可以解决它:

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

0 回答 0