编辑文本焦点机器人 [英] Edit Text focus in android

查看:83
本文介绍了编辑文本焦点机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用我有编辑文本如下:

In my application i have edit text as follows.

EditText1   EditText2
EditText3   EditText4
EditText5   EditText6

在XML我声明的android:imeOptions =actionNext也是我写

in xml i declared android:imeOptions="actionNext" and also i write

          editText1.setOnEditorActionListener(new EditText.OnEditorActionListener() {
        public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
                // TODO Auto-generated method stub
                 if (actionId == EditorInfo.IME_ACTION_DONE ||   actionId == EditorInfo.IME_ACTION_NEXT) {
                     editText2.requestFocus();

                  return false;
                  }
                return false;
            }
         });

现在在编辑文本1虚拟键盘,如果我下次preSS我得到重点放到编辑文字3,而不是editText2等。

Now in virtual key board in edit text 1 if i press next i am getting focus into edit text3 instead of editText2 etc.

我怎样才能在EditText2获得焦点,而不是edittext3的
我的应用程序用户只preSS下一步或完成的。他从不为轨迹球。

How can i get focus on EditText2 instead of edittext3 for my application user only press "Next or done" he never goes for trackball.

推荐答案

您可以尝试添加的android:nextFocusDown 在属性的 EditTexts

You could try adding the android:nextFocusDown attribute in your EditTexts.

这篇关于编辑文本焦点机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆