EditText不会自动启动 [英] EditText doesn't start automatically

查看:51
本文介绍了EditText不会自动启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用中,我有一个 EditText .我如何使其无法自动启动?就像:一旦他们打开活动,它将自动将鼠标设置为 EditText 并打开键盘,以便他们输入…

In my app, I have an EditText. How do I make it doesn't start automatically? Like: once they open the activity it automatically sets the mouse to the EditText and the keyboard gets opened so they type…

当他们单击它时,我是否可以打开它(显示键盘并且用户可以键入)?

Is there anyway I can make it open (the keyboard shows and the user can type) when they clicks on it?

推荐答案

好,所以从您的问题中我发现您的EditText在开始活动时正在获得焦点.您可以使用以下命令禁用焦点来抑制键盘.

Ok, so from your question i figure out that your EditText is getting focus while starting the activity. You can disable the focus using following command to suppress the keyboard.

getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN);

访问此关闭/隐藏Android软键盘

这篇关于EditText不会自动启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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