Can you set “tab order” in XML Layout?

前端 未结 7 2240
不思量自难忘°
不思量自难忘° 2020-12-05 16:49

I\'ve got users with tablets that have a tab key on their soft keyboard. I am using a table view and have 3 EditText Fields in one row with EditText fields below the curren

7条回答
  •  北荒
    北荒 (楼主)
    2020-12-05 17:25

    There is a better way. There is an XML argument that you can put in your layout that automatically moves the cursor through each EditText as the user completes them. This allows for much easier form implementation.

    Problem is, for the damn life remember what hell it is...

    Be sure to check out the android:nextFocus* xml properties. Normal form action is to go down. But perhaps there's a button to the right that you'd like to receive next focus (like hitting enter or similar).

    http://developer.android.com/reference/android/view/View.html#attr_android:nextFocusDown

    There's also some programatic options available:

    http://developer.android.com/reference/android/view/View.html#setNextFocusDownId(int)

提交回复
热议问题