protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
SetContentView (Resource.Layout.Main);
Button button = FindViewById<Button> (Resource.Id.button1);
button.Click+= onClick;
EditText es=FindViewById<EditText>(Resource.Id.editText1);
es.EditorAction += (object sender, TextView.EditorActionEventArgs e) =>
{
if ( e.ActionId == Android.Views.InputMethods.ImeAction.Done )
{
var editText = sender as EditText;
var inputManager = GetSystemService(InputMethodService) as InputMethodManager;
inputManager.HideSoftInputFromWindow(editText.WindowToken, 0);
}
};
EditText es1=FindViewById<EditText>(Resource.Id.editText2);
es1.EditorAction += (object sender, TextView.EditorActionEventArgs e) =>
{
if ( e.ActionId == Android.Views.InputMethods.ImeAction.Done )
{
var editText = sender as EditText;
var inputManager = GetSystemService(InputMethodService) as InputMethodManager;
inputManager.HideSoftInputFromWindow(editText.WindowToken, 0);
}
};
}
我在上面的代码中使用了给定的方法。我不想显示两个文本框的软键盘。它不起作用,我写错了吗?