0
我有一個帶Textview的RelativeLayout和幾個EditText,最後是一個帶有兩個EditText的LinearLayout。當我運行應用程序時,按Next鍵盤焦點可以正常工作,從一個EditText到另一個EditText。但是,當焦點位於LinearLayout的第一個EditText時,焦點不會移動到另一個EditText。EditText沒有收到重點
請幫助
這是我的佈局文件:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="10dp">
<TextView
android:id="@+id/txt_nombre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_nombre" />
<EditText
android:id="@+id/edi_nombre"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textCapWords"
android:layout_below="@id/txt_nombre" />
<TextView
android:id="@+id/txt_apellido"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_apellido"
android:layout_below="@id/edi_nombre" />
<EditText
android:id="@+id/edi_apellido"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textCapWords"
android:layout_below="@id/txt_apellido" />
<TextView
android:id="@+id/txt_username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_username"
android:layout_below="@id/edi_apellido" />
<EditText
android:id="@+id/edi_username"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textCapWords"
android:layout_below="@id/txt_username" />
<TextView
android:id="@+id/txt_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/lbl_email"
android:layout_below="@id/edi_username" />
<EditText
android:id="@+id/edi_email"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="textEmailAddress"
android:layout_below="@id/txt_email" />
<LinearLayout
android:id="@+id/lyo_pwd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/edi_email"
android:focusableInTouchMode="false"
android:orientation="horizontal" >
<TextView
android:id="@+id/txt_pwd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/lbl_pwd"
android:layout_weight="1" />
<TextView
android:id="@+id/txt_repwd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="@string/lbl_repwd"
android:layout_weight="1" />
</LinearLayout>
<LinearLayout
android:id="@+id/lyo_edipwd"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/lyo_pwd"
android:orientation="horizontal"
android:padding="2dp" >
<EditText
android:id="@+id/edi_pwd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_weight="1" />
<EditText
android:id="@+id/edi_repwd"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:singleLine="true"
android:inputType="text"
android:imeOptions="actionNext"
android:layout_weight="1"/>
</LinearLayout>
<Button
android:id="@+id/btn_registrar"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/btn_registrar"
android:layout_below="@id/lyo_edipwd" />
</RelativeLayout>
有沒有使用Java代碼的任何解決方案?
是在模擬器上或實際運行這個設備? – avrono
在模擬器和處置器 – Walcasar