Android ListView, with EditText ListItem move to Next

╄→гoц情女王★ 提交于 2020-01-25 10:04:28

问题


I have a ListView that has ListItem with EditText. This is to simulate a long Form. Once the user is done entering field, I want the cursor to move to next row, i.e. Next ListItem.

To get the next button, in the ListItem xml, I set the ime option to next:

<EditText
    android:id="@+id/input_text"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:imeOptions="actionNext"/>

The form could be long with over 20 items to enter. At a given time only 7 rows are visible. which means 7 ListItem rows will be initialized and reused as "convert view". Just by adding the above ime option, the default implementation would would focus to next until the 7th item and would go back to 1 instead of going to 8th item.

How can I make the next go to next item position instead of going back to 1st?

来源:https://stackoverflow.com/questions/26343936/android-listview-with-edittext-listitem-move-to-next

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!