如何设置焦点按钮? [英] How to set the focus on button?
问题描述
您好我有一些EditTexts并在视图的底部的按钮。在启动活动,第一次的EditText将获得焦点和键盘将弹出。我想在开始活动中,重点将放在按钮代替的EditText和键盘不应该弹出。我试图运行:
Hi I have some EditTexts and a button at the bottom of the view. Upon starting the activity, the first EditText will gain focus and a keyboard will pop up. I want to upon starting the activity, the focus will be on the button instead of the EditText and the keyboard should not pop up. I tried running:
button.requestFocus();
在EditText上仍然有重点和弹出键盘。我怎样才能解决这个问题?谢谢你。
The EditText still have focus and pops up the keyboard. How can I resolve this? Thanks.
推荐答案
它的麻烦似乎比,但绝对有可能。在这里看到:
Its trickier than it seems, but certainly possible. See here:
<一个href=\"http://stackoverflow.com/questions/1555109/stop-edittext-from-gaining-focus-at-activity-startup\">Stop从的EditText在活动启动时获得焦点?
这篇关于如何设置焦点按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!