Android应用程序开始与虚拟键盘开放 [英] Android App start with virtual keyboard open

查看:122
本文介绍了Android应用程序开始与虚拟键盘开放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个应用程序为Android手机和我的启动画面后,显示其中有几个纺纱和意见的EditText活动。

I am writing an app for android phones and after my splash screen it shows an activity which has several spinners and edittext views.

在不使用键盘的Andr​​oid设备则显示虚拟键盘,然后阻止应用程序的其余部分,看起来不专业我。我试图隐藏虚拟键盘,不过activity.onCreate方法无济于事那里。

On an android device without a keyboard it shows the virtual keyboard which then blocks the rest of the app and looks unprofessional to me. I have tried to hide the virtual keyboard in the activity.onCreate method however no avail there.

我的下一个选择,我想是设置的聚焦状态监听到实际问题的EditText上来看,仍然无济于事。

My next option I tried was setting an onFocus listener to the actual offending edittext view and still no avail.

我怎么能prevent虚拟键盘无法显示,直到用户明确地点击一个EditText看法?有没有办法给的微调的重点之一,因为纺织家一个是在布局XML中的EditText视图之前?

How can I prevent the virtual keyboard from showing until a user explicitly clicks an edittext view? Is there a way to give one of the spinner's focus since one of the spinners is before the edittext view in the layout xml?

推荐答案

您可以尝试设置机器人:你的Activity在AndroidManifest.xml文件条目windowSoftInputMode 属性。我认为它设置为 stateHidden 可以做你想做的。

You can try setting the android:windowSoftInputMode attribute of your Activity's entry in the AndroidManifest.xml file. I think setting it to stateHidden might do what you want.

这里的 文档从Android网站。

这篇关于Android应用程序开始与虚拟键盘开放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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