&引用;“科达巴”;Zxing在Xamarin.ios中生成条形码失败

&引用;“科达巴”;Zxing在Xamarin.ios中生成条形码失败,ios,xamarin.ios,barcode,zxing,Ios,Xamarin.ios,Barcode,Zxing,我想同时显示二维码和密码 这是我的密码 var qrcodeWriter = new ZXing.Mobile.BarcodeWriter { Format = ZXing.BarcodeFormat.QR_CODE, Options = new ZXing.Common.EncodingOptions { Width = 400, Height = 400, Margin = 1 } }; var qrcode = qrco

我想同时显示二维码和密码

这是我的密码

var qrcodeWriter = new ZXing.Mobile.BarcodeWriter {
    Format = ZXing.BarcodeFormat.QR_CODE,
    Options = new ZXing.Common.EncodingOptions {
        Width = 400,
        Height = 400,
       Margin = 1
    }
};
var qrcode = qrcodeWriter.Write (order.order_number);
imageQR.Image = qrcode;

var barcodeWriter = new ZXing.Mobile.BarcodeWriter {
    Format = ZXing.BarcodeFormat.CODABAR,
    Options = new ZXing.Common.EncodingOptions {
        Width = 400,
        Height = 80,
        Margin = 1
    }
};
var barcode = barcodeWriter.Write (order.order_number);
imageBar.Image = barcode;
二维码成功,但条形码编写器.write函数中的codabar失败

请帮帮我

错误代码:

ex{System.ArgumentException:无法在ZXing.OneD.CodaBarWriter.encode(System.String co..}System.ArgumentException处编码:“T”

调用堆栈:

/Volumes/Untitled/MsterBee_TEMP/MasterBee/ViewControllers/History/HistoryDetailViewController.viewdiload()中的MasterBee.HistoryDetailViewController.viewdiload()。cs:69

中的UIKit.UIApplication.UIApplicationMain() 在/Users/builder/data/lanes/3339/39ebb778/source/maccore/src/UIKit/UIApplication.cs:79中,UIKit.UIApplication.Main(字符串[]参数,System.IntPtr主体,System.IntPtr委托)

/Users/builder/data/lanes/3339/39ebb778/source/maccore/src/UIKit/UIApplication.cs中的UIKit.UIApplication.Main(字符串[]args、字符串principalClassName、字符串delegateClassName)

MasterBee.Application.Main(string[]args)在/Volumes/Untitled/MsterBee_TEMP/MasterBee/Main.cs:15中,错误消息“Cannot encode'T'”表示应该编码的内容不能被编码为Codabar。如果不知道“order.order\u number”的值,就无法说出内容的错误。 通常,如果要将其编码为Codabar,则只允许在内容的开头和结尾使用字符“T”。 示例:T1234567890T正常,T12345T67890T不正常。

我找到了原因

这是CODABAR的格式

条形码的格式各不相同

所以如果你用QRcode的格式文本制作CODABAR,它就会崩溃


此外,CODE_128和QRcode的格式相同。

您的错误/异常是什么?ex{System.ArgumentException:无法在ZXing.OneD.CodaBarWriter.encode(System.String co..}System.ArgumentException)处编码:“T”。请通过编辑问题添加异常和stacktrace。我添加了错误代码stacktrace在哪里?谢谢您的帮助。