为什么编辑器的Completed事件随机触发?

问题描述 投票:-1回答:1

我的Xamarin.Forms应用程序具有一个ListView,其中每个ViewCell都包含一个编辑器。只要轻按“编辑器”,就会触发Focused事件,即使未在键盘上按Done或Enter也会触发Completed事件。怎么回事,如何解决?

c# xaml xamarin xamarin.forms
1个回答
0
投票

改为使用TextChanged事件https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/text/editor

void EditorTextChanged (object sender, TextChangedEventArgs e)
{
   var oldText = e.OldTextValue;
   var newText = e.NewTextValue;
}
© www.soinside.com 2019 - 2024. All rights reserved.