我有一个布局,并希望通过“下一步”按钮获得良好的导航。
一切正常,但在字段“et_numero”中,光标焦点到下一个字段,这没关系,但屏幕滚动到顶部,我不知道为什么!
任何帮助都会被贬低!
<LinearLayout
android:id="@+id/ll_addpdv1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin">
<!-- Aqui empieza el formulario -->
<android.support.design.widget.TextInputLayout
android:id="@+id/til_pdv_name"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/et_pdv_name"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/pdv_name"
android:inputType="text"
android:nextFocusDown="@+id/et_dueno" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_dueno"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:imeOptions="actionNext">
<EditText
android:id="@+id/et_dueno"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/nombre_dueno"
android:imeOptions="actionNext"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="@+id/sp_proyectos"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/layout_bg"
android:focusable="true"
android:nextFocusDown="@+id/et_calle"
android:padding="20dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:id="@+id/til_calle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="0.2">
<EditText
android:id="@+id/et_calle"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="@string/calle2"
android:imeOptions="actionNext"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_numero"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:nextFocusDown="@+id/et_colonia"
android:layout_weight="0.8">
<EditText
android:id="@+id/et_numero"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:hint="@string/numero"
android:imeOptions="actionNext"
android:inputType="number" />
</android.support.design.widget.TextInputLayout>
</LinearLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_colonia"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/et_colonia"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/colonia2"
android:imeOptions="actionNext"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<Spinner
android:id="@+id/sp_ciudades"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:background="@drawable/layout_bg"
android:imeOptions="actionNext"
android:padding="20dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:id="@+id/til_cp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.3"
>
<EditText
android:id="@+id/et_cp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/cp"
android:imeOptions="actionNext"
android:inputType="number"
android:maxLength="5"
/>
</android.support.design.widget.TextInputLayout>
<android.support.design.widget.TextInputLayout
android:id="@+id/til_tel"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.7"
>
<EditText
android:id="@+id/et_tel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="@string/telefono2"
android:imeOptions="actionDone"
android:inputType="phone"
/>
</android.support.design.widget.TextInputLayout>
</LinearLayout>
</LinearLayout>
<Button
android:id="@+id/b_next1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/ll_addpdv1"
android:background="@drawable/button_azul_states"
android:paddingBottom="50dp"
android:paddingTop="50dp"
android:text="@string/siguiente"
android:textColor="@color/white" />
</RelativeLayout>