我正在使用ZXing.Net.Mobile并具有以下代码来扫描QR代码。QR代码扫描在UWP中不起作用
await scanner.Scan().ContinueWith(t =>
{
if (t.Result != null)
HandleScanResult(t.Result);
});
scanner.UseCustomOverlay = false;
scanner.ScanContinuously(async (res) =>
{
var msg = "Found Barcode: " + res.Text;
await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async() =>
{
ViewHelper.showMessage(msg, "");
});
});
我试过了ContinueWith和ScanContinuosly,但都没有工作。 我使用红线获取相机视图,但不扫描QR码。
我在哪里出错了。
第一行代码困扰了我很多 – Alex
好吧,我解决了这个问题,通过手动卸载nuget并添加所需的项目https://github.com/Redth/ZXing.Net.Mobile。 也更新了Microsoft.NetCore.UniversalWindowsPlatform。我猜目前的nuget包存在一些问题。希望他们解决这个问题 – AbsoluteSith