0
enter image description hereフォーカスを移動
私はこのアプリを構築していると私は、ユーザーが写真のように、softkeyboardの[次へ]ボタンをEditTextsのフォーカスを変更たい それはちょうど私がのEditTextの所望のIDで
android:nextFocussForward
を使用 最初の列の下の焦点のすべての方法を移動するが、それはうまくいきませんでした(nextfoucusleft /右/アップ/ダウン動作しませんでした)
それは、各行の親垂直リニアレイアウト が含まれてここに水平直線レイアウト
はXMLです:
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context=".MainActivity">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/header"
>
<TextView
android:text="@string/ecrit"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:textSize="@dimen/text_size_label"
android:textAlignment="center"/>
<TextView
android:text="@string/orale"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="@dimen/text_size_label"
android:layout_weight="1" />
<TextView
android:text="@string/lecture"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="@dimen/text_size_label"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cells"
>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/ecrit1"
android:inputType="number"
android:maxLength="3"
/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/orale1"
android:inputType="number"
android:maxLength="3"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/lecture1"
android:inputType="number"
android:maxLength="3"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cells"
>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/ecrit2"
android:inputType="number"
android:maxLength="3"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/orale2"
android:inputType="number"
android:maxLength="3"
/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/lecture2"
android:inputType="number"
android:maxLength="3"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cells"
>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/ecrit3"
android:inputType="number"
android:maxLength="3"
android:nextFocusRight="@id/orale1"
android:nextFocusForward="@id/orale1"
android:nextFocusDown="@id/orale1"
android:nextFocusUp="@id/orale1"
android:nextFocusLeft="@id/orale1"
/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/orale3"
android:inputType="number"
android:maxLength="3"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/lecture3"
android:inputType="number"
android:maxLength="3"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:background="@color/result"
>
<TextView
android:paddingLeft="8dp"
android:text="@string/zero"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:textSize="@dimen/text_size_label"
android:textAlignment="center"/>
<TextView
android:paddingLeft="8dp"
android:text="@string/zero"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="@dimen/text_size_label"
android:layout_weight="1" />
<TextView
android:paddingLeft="8dp"
android:text="@string/zero"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="@dimen/text_size_label"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dp"
android:background="@color/header"
>
<TextView
android:text="@string/examen_ecrit"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:layout_weight="1"
android:textSize="@dimen/text_size_label"
android:textAlignment="center"/>
<TextView
android:text="@string/examen_orale"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="@dimen/text_size_label"
android:layout_weight="1" />
<TextView
android:text="@string/examen_finale"
android:layout_height="wrap_content"
android:layout_width="0dp"
android:textSize="@dimen/text_size_label"
android:layout_weight="1"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/cells"
>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/ecritFinal"
android:inputType="number"
android:maxLength="3"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/oraleFinal"
android:inputType="number"
android:maxLength="3"/>
<EditText
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:id="@+id/finaleFinal"
android:inputType="number"
android:maxLength="3"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dp"
>
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:background="@color/header"
android:text="@string/classactivity"
android:textSize="@dimen/text_size_label"/>
<TextView
android:textSize="@dimen/text_size_label"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:background="@color/result"
android:text="@string/zero"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginTop="15dp"
>
<TextView
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:background="@color/header"
android:text="@string/finalgrade"
android:textSize="@dimen/text_size_label"/>
<TextView
android:textSize="@dimen/text_size_label"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:background="@color/result"
android:text="@string/zero"/>
</LinearLayout>
</LinearLayout>