简体   繁体   中英

Issue need to press the back to input in android

I have registration screen in android. When user start to type then to enter the value in next EditText then need to press the back then type and so on.

Please help me such user need not to press back button many times to input.

<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"
android:background="@android:color/white" >

<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginLeft="20dp"
    android:layout_marginRight="20dp" 
    android:layout_gravity="center_horizontal"
    android:gravity="center">

    <EditText
        android:id="@+id/senderphoneNumber"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_marginTop="30dp" 
        android:gravity="center"
        android:hint="SENDER PHONE NUMBER" 
        android:ellipsize="start"
        android:inputType="number"/>

    <EditText
        android:id="@+id/phoneNumber"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_marginTop="20dp"
        android:gravity="center"
        android:hint="RECIEVER PHONE NUMBER" 
        android:ellipsize="start"
        android:inputType="number"
        android:layout_below="@id/senderphoneNumber"/>

    <EditText
        android:id="@+id/messageText"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_marginTop="20dp"
        android:gravity="center"
        android:hint="TEXT MESSAGE" 
        android:layout_below="@id/phoneNumber"
        android:imeOptions="actionNext"/>

    <EditText 
        android:id="@+id/mmsCentralURL"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_marginTop="20dp"
        android:gravity="center"
        android:hint="MMS CENTRAL URL" 
        android:layout_below="@id/messageText"
        android:imeOptions="actionNext"/>

    <EditText 
        android:id="@+id/proxyURL"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_marginTop="20dp"
        android:gravity="center"
        android:hint="MMS PROXY" 
        android:layout_below="@id/mmsCentralURL" 
        android:imeOptions="actionNext"/>

     <EditText 
        android:id="@+id/port"
        android:layout_width="fill_parent"
        android:layout_height="50dip"
        android:layout_marginTop="20dp"
        android:gravity="center"
        android:hint="MMS PORT" 
        android:layout_below="@id/proxyURL" 
        android:imeOptions="actionDone"/>


    <Button
        android:id="@+id/chooseImage"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_marginTop="30dp"
        android:background="@drawable/rounded_button"
        android:text="PICK IMAGE" 
        android:layout_below="@id/port"/>

    <Button
        android:id="@+id/sendButton"
        android:layout_width="fill_parent"
        android:layout_height="40dp"
        android:layout_marginTop="30dp"
        android:background="@drawable/rounded_button"
        android:text="SEND" 
        android:layout_below="@id/chooseImage"/>

    <TextView android:id="@+id/emptyTV"
        android:layout_width="fill_parent"
        android:layout_height="30dp"
        android:layout_below="@id/sendButton"/>

Use android:imeOptions="actionDone" on last edittext

For Next - android:imeOptions="actionNext"

For Done - android:imeOptions="actionDone"

- Or -

You can also go with android:nextFocusDown="@+id/next_edit_text"

Check this link: http://developer.android.com/guide/topics/ui/controls/text.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM