Xamarin.Android textview事件处理程序

时间:2017-09-28 12:57:52

标签: c# android xamarin xamarin.android mvvmcross

我有一个MvxAutoCompleteTextView,它有一个事件处理程序(KeyPress) 但是当我按下回车键时才会调用该事件!

我也有一个几乎相同的MvxAutoCompleteTextView,它的事件处理程序确实可以正常工作。有人遇到此事吗?

    {    
        klantNummerTextView.KeyPress += KeyPress;
        klantNaamTextView.KeyPress += KeyPress;
    }

    private void KeyPress(object sender, View.KeyEventArgs e)
    {}

这是他们的xml:

    <android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:layout_marginBottom="0dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp">
    <MvvmCross.Binding.Droid.Views.MvxAutoCompleteTextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="Klant nummer"
      android:inputType="numberDecimal"
      android:id="@+id/nummertextbox"
      local:MvxItemTemplate="@layout/klanthintitemtemplate"
      local:MvxBind="Text KlantResponse.Nummer; ItemsSource KlantNamen; 
     PartialText CurrentKlantHint; SelectedObject SelectedKlant" />
     </android.support.design.widget.TextInputLayout>

  <android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="8dp"
    android:layout_marginBottom="0dp"
    android:layout_marginLeft="8dp"
    android:layout_marginRight="8dp">
    <MvvmCross.Binding.Droid.Views.MvxAutoCompleteTextView
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:hint="Klant naam"
      android:inputType="text"
      android:id="@+id/naamtextbox"
      local:MvxItemTemplate="@layout/klanthintitemtemplate"
      local:MvxBind="Text KlantResponse.Naam; ItemsSource KlantNamen; 
      PartialText CurrentKlantHint; SelectedObject SelectedKlant" />
  </android.support.design.widget.TextInputLayout>

0 个答案:

没有答案