I add ZXing.Net.Mobile, ZXing.Net.Mobile.Forms to project. Here is the code:
using ZXing.Net.Mobile.Forms;
using ZXing.Net.Mobile;
namespace discountapp
{
public partial class discountappPage : ContentPage
{
ZXingBarcodeImageView barcode;
public void Handle_Clicked(object sender, System.EventArgs e)
{
barcode = new ZXingBarcodeImageView
{
HorizontalOptions = LayoutOptions.Center,
VerticalOptions = LayoutOptions.Center
};
barcode.BarcodeFormat = ZXing.BarcodeFormat.EAN_13;
barcode.BarcodeOptions.Height = 25;
barcode.BarcodeOptions.Width = 75;
barcode.BarcodeValue = "2800100028014";
Content = barcode;
}
}
}
For iOS platform also add ZXing.Net.Mobile, ZXing.Net.Mobile.Forms and put some changes in AppDelegate's FinishedLaunching() implementation:
global::ZXing.Net.Mobile.Forms.iOS.Platform.Init();
For Android platform also add ZXing.Net.Mobile, ZXing.Net.Mobile.Forms and put some changes in MainActivity's OnCreate() method:
global::ZXing.Net.Mobile.Forms.Android.Platform.Init();
But after I click the button, it doesn't show Barcode, just nothing without error. Could you help, please!