简体   繁体   English

EditText下一个按钮键盘

[英]EditText next Button keyboard

i have a layout which the user need to write his detailes in some editText which placed in a vertical linearLayout. 我有一个布局,用户需要将其detailes写入一些放置在垂直linearLayout中的editText中。

however, everyTime the user need to open the keyboard, write something on the editText and then to click on the back button in android and again click on the next editText and write his detailes and again over and over. 但是,每次用户都需要打开键盘,在editText上写一些东西,然后单击android中的“后退”按钮,然后再次单击下一个editText并一次又一次地写他的详细信息。

i want to implement that instead of opening and closing the keyboard, instead of the enter button on keyboard i will have a next Button that after the user entered his detailes on a spesific EditText , it will skip to the next EditText without closing and opening the keyboard every time. 我想实现它,而不是打开和关闭键盘,而不是键盘上的Enter按钮,我将拥有一个next Button,该按钮在用户在特殊的EditText上输入其详细信息之后,它将跳至下一个EditText,而无需关闭和打开键盘。每次都使用键盘。

i saw that there is some apps that has this feature, however i didnt find how can i implement it 我看到有些应用程序具有此功能,但是我没有找到如何实现它的功能

thanks alot 非常感谢

here is the example of my layout: 这是我的布局示例:

<LinearLayout
        android:layout_width="283dp"
        android:layout_height="match_parent"
        android:layout_marginLeft="20dp"
        android:layout_marginRight="20dp"
        android:orientation="vertical" >



        <TextView
            android:id="@+id/aaa"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="aaaa" >

            <requestFocus />
        </TextView>

        <EditText
            android:id="@+id/bbb"
            android:layout_width="match_parent"
            android:layout_height="36dp"
            android:background="@drawable/text_back"
            android:ems="10"
            android:inputType="bbb" />

        <TextView
            android:id="@+id/cccc"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="ccc" />

        <EditText
            android:id="@+id/emailTextGroup"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:background="@drawable/text_back"
            android:ems="10"
            android:inputType="textMultiLine" />

        <TextView
            android:id="@+id/dd"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="ddd" />

        <EditText
            android:id="@+id/fff"
            android:layout_width="match_parent"
            android:layout_height="38dp"
            android:background="@drawable/text_back"
            android:ems="10"
            android:inputType="fff" />

        <TextView
            android:id="@+id/yyy"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="yyy" />

        <EditText
            android:id="@+id/eeee"
            android:layout_width="match_parent"
            android:layout_height="32dp"
            android:background="@drawable/text_back"
            android:ems="10"
            android:inputType="textMultiLine" />

         <TextView
            android:id="@+id/yyyy"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="iii" />

        <EditText
            android:id="@+id/ooo"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:background="@drawable/text_back"
            android:ems="10"
            android:inputType="textMultiLine" />

        <TextView
            android:id="@+id/ppp"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:ems="10"
            android:inputType="ppp" />

        <EditText
            android:id="@+id/sss"
            android:layout_width="match_parent"
            android:layout_height="30dp"
            android:background="@drawable/text_back"
            android:ems="10"
            android:inputType="textMultiLine" />



    </LinearLayout>

You should add in the XML file an attribute to your EditText s: 您应该在XML文件中为EditText添加一个属性:

android:imeOptions="actionNext" . android:imeOptions="actionNext"

The next button will bring the user into the next field that can receive input. 下一个按钮将使用户进入可以接收输入的下一个字段。

There is a very good Documentation for this: 有一个很好的文档:

nextFocusDown nextFocusDown

If I understand you correctly this tab order is exactly what you need. 如果我对您的理解正确,那么此制表符顺序正是您所需要的。

this is how my editText is and it has the next button and does is 这是我的editText的样子,它具有下一步按钮,并且确实是

<EditText
        android:id="@+id/typefish"
        android:layout_width="370dp"
        android:layout_height="wrap_content"

        android:singleLine="true" />

the one after it or the last one also has 之后的那个或最后一个也有

android:imeOptions="actionDone"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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