2017-10-06 6 views
0

2つのeditTextウィジェットだけを含む単純なrecyclerViewを作成すると、データを入力するときに次のフォーカス要素の方向がpic1のようになります--- pic2のような次のフォーカス要素の方向を設定する方法? 歓声recycleViewウィジェットの次のフォーカス方向

pic1

pic2

私の単純なコード

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <EditText 
     android:id="@+id/edit_text_left" 
     tools:hint="editTextLeft" 
     android:layout_width="0dp" 
     android:layout_weight="1" 
     android:layout_height="wrap_content" /> 

    <EditText   
     android:id="@+id/edit_text_right" 
     tools:hint="editTextRight" 
     android:layout_width="0dp" 
     android:layout_weight="1" 
     android:layout_height="wrap_content" /> 

</LinearLayout> 

答えて

1

あなたのラ作る次Editext

<EditText 
    android:id="@+id/edit_text_left" 
    tools:hint="editTextLeft" 
    android:layout_width="0dp" 
    android:layout_weight="1" 
    android:inputType="text" 
    android:imeOptions="actionNext" 
    android:layout_height="wrap_content" /> 

にフォーカスを移動するには、この使用android:imeOptions="actionNext"を試してみてくださいyout like this

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:orientation="horizontal" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content"> 

    <EditText 
     android:id="@+id/edit_text_left" 
     tools:hint="editTextLeft" 
     android:layout_width="0dp" 
     android:layout_weight="1" 
     android:inputType="text" 
     android:imeOptions="actionNext" 
     android:layout_height="wrap_content" /> 

    <EditText   
     android:id="@+id/edit_text_right" 
     tools:hint="editTextRight" 
     android:layout_width="0dp" 
     android:layout_weight="1" 
     android:inputType="text" 
     android:imeOptions="actionNext" 
     android:layout_height="wrap_content" /> 

</LinearLayout> 
関連する問題