【发布时间】:2019-02-28 02:04:57
【问题描述】:
我一直在尝试使用 ZXing.Net.Mobile 和 ZXing.Net.Mobile.Forms 生成 QRCode: https://github.com/Redth/ZXing.Net.Mobile 并遇到以下错误:
"严重性代码描述项目文件行抑制状态 错误 CS0305 使用通用类型“BarcodeWriter”需要 1 个类型参数 TestApp.Android G:\Tests\TestApp\TestApp\TestApp.Android\SelectedBookingPage.cs 70 活动 "
这是我的代码:
BarcodeWriter writer = new BarcodeWriter()
{
Format = BarcodeFormat.QR_CODE,
Options = new ZXing.Common.EncodingOptions
{
Height = 600,
Width = 600
}
};
我见过的其他例子像上面一样调用 BarcodeWriter() 就可以了,https://csharp.hotexamples.com/examples/ZXing/BarcodeWriter/-/php-barcodewriter-class-examples.html 列出了一些。
为什么调用 BarcodeWriter 需要类型参数。如何正确实例化 BarcodeWriter 的实例?
【问题讨论】:
标签: c# xamarin xamarin.android zxing