Android应用程序开始与虚拟键盘开放应用程序、键盘、Android

由网友(假装很幸福)分享简介:我在写一个应用程序为Android手机和我的启动画面后,显示其中有几个纺纱和意见的EditText活动。 I am writing an app for android phones and after my splash screen it shows an activity which has several s...

我在写一个应用程序为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网站。

阅读全文

相关推荐

最新文章