2016-02-05 2 views
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 next bt, это не сработало скрыть клавиатуру.

ответ

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; 
    } 
}); 
+0

я использую, что Б.Т. он сделал работу, и у меня есть много использования этого настраиваемого представления в моем приложении. –

+0

его работа над моим делом. Хорошо, дайте мне попробовать больше для вашего решения. –

0

Используйте android:nextFocusDown параметров, чтобы указать, какое поле вы хотели бы получить фокус, когда пользователь нажимает клавишу ввода.

Пример:

android:inputType="text" 
android:nextFocusDown="@+id/..." 
+0

Не работает i hd, прежде чем задавать вопрос –

+0

работает над myside. может быть потому, что вы используете customEditText @VRRanga –

+0

android: nextFocusDown не применим на вашем com.paisa.main.base.ui.widget.CustomEditText, но полезен для android.support.design.widget.TextInputLayout @VRRanga –

Смежные вопросы