0
Xamarin FormsにQRコードアプリケーションを作成しています。このアプリケーションは、テキスト入力で入力文字列を取り込んでQRコードに変換します。私はhereというこのウェブサイトと同様に、テキスト入力で入力を入力または削除している間にQRコードを動的に変更したいと思います。Xamarin - TextChanged()イベントのQRコードを置き換えます。
私はこれがTextChangeEventArgs
を使用して可能だと信じていますが、それがどのように機能するのかは分かりません。私はここで何が欠けていますか?
MyEntryChangedイベントがで発生するので、ここで私のテキスト入力
var myEntry = new Entry
{
Text = "Hello SO"
};
が(それはまだ何によって呼び出されていない)
void MyEntryChanged(Entry myEntry, TextChangedEventArgs e)
{
barcode = new ZXingBarcodeImageView
{
HorizontalOptions = LayoutOptions.FillAndExpand,
VerticalOptions = LayoutOptions.FillAndExpand,
AutomationId = "zxingBarcodeImageView",
};
barcode.BarcodeFormat = ZXing.BarcodeFormat.QR_CODE;
barcode.BarcodeOptions.Width = 300;
barcode.BarcodeOptions.Height = 300;
barcode.BarcodeOptions.Margin = 10;
barcode.BarcodeValue = myEntry.Text;
Content = barcode;
}
:
次のようなコードを使用する必要があります – Jason