0

私はcustomEditTextを持っています

 <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">

<android.support.design.widget.TextInputLayout
    android:id="@+id/input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_margin="@dimen/five_margin"
    android:focusableInTouchMode="true"
    android:orientation="horizontal"
    app:hintTextAppearance="@style/TextAppearence.App.TextInputLayout"
   >

    <EditText
        android:id="@+id/edt_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:singleLine="true"
        android:textSize="@dimen/sub_heading"
        android:textColorHint="@color/hind_text_col0r"
        android:inputType="textCapSentences|textAutoCorrect|textMultiLine"
        android:textColor="@color/active_text_col0r"
      />

</android.support.design.widget.TextInputLayout>

そしてそれを使用して次のように

   <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.paisa.main.base.ui.widget.CustomEditText
        android:id="@+id/custom_edt_investor_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:imeOptions="actionNext"
        />

        <com.paisa.main.base.ui.widget.CustomEditText
        android:id="@+id/custom_edt_nominee_name"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

ソフト入力キーボードを介して投資家名を被指名者名編集テキストに移動するにはどうすればよいですか?次にimeoptionを使用しましたが、キーボードを非表示にすることはできませんでした。

4

2 に答える 2

0

これはあなたを助けるでしょう:-すべてのTextViewのためにこれを作ってください...

custom_edt_investor_name.setOnKeyListener(new OnKeyListener() {

    public boolean onKey(View v, int keyCode, KeyEvent event) {
          // If the event is a key-down event on the "enter" button
          if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
               (keyCode == KeyEvent.KEYCODE_ENTER))
          {
                // Perform action on Enter key press
                custom_edt_investor_name.clearFocus();
                custom_edt_nominee_name.requestFocus();
                return true;
          }
          return false;
    }
});
于 2016-02-05T06:31:17.140 に答える
0

パラメータを使用してandroid:nextFocusDown、ユーザーが Enter キーを押したときにフォーカスを取得するフィールドを指定します。

android:inputType="text"
android:nextFocusDown="@+id/..."
于 2016-02-05T06:32:51.397 に答える