关闭软键盘Android中,直到的EditText选择 [英] Disable Software Keyboard in Android until EditText is chosen

查看:186
本文介绍了关闭软键盘Android中,直到的EditText选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能prevent软键盘消失,直到一个特定的EditText是choosen?我有几个EditTexts在我的布局,当它开了第一家被自动选中,软键盘显示。

how can I prevent the software keyboard to disappear until a specific EditText is choosen? I have several EditTexts in my Layout when it is opened the first is automatically selected and the software keyboard is shown.

我知道我可以通过设置的android禁用此:作为焦点=假。但后来就不可能按一下该项目并获得显示的项目。

I know i can disable this by setting android:focusable="false". But then it is impossible to click on the item and get the item displayed.

我想:该活动已启动,用户可以看到所有EditTexts,那么他点击一个和软件键盘打开之类的东西可以在EditText上输入。这可能吗?

What I want: The activity is started and the user sees all EditTexts, then he clicks on one and the software keyboard opens and stuff can be entered in the EditText. Is this possible?

推荐答案

在你的活动的onCreate()

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

这篇关于关闭软键盘Android中,直到的EditText选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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