2016-02-05 48 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 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

我使用BT它沒有工作,我有我的應用程序大量使用該自定義視圖的。 –

+0

其對我的案件的工作。好的,讓我試試更多的解決方案。 –

0

使用android:nextFocusDown參數去指定你想要哪個字段獲得焦點,當用戶點擊回車鍵。

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

不能正常工作我提問之前使用 –

+0

它的工作謎。可能是因爲你正在使用customEditText @VRRanga –

+0

android:nextFocusDown不適用於你的com.paisa.main.base.ui.widget.CustomEditText,但對於android.support.design.widget.TextInputLayout是有用的@VRRanga –

相關問題