键盘布局隐藏Android的动作吧? [英] Keyboard layout hiding android action bar?

查看:108
本文介绍了键盘布局隐藏Android的动作吧?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Andr​​oid运行在XOOM设备应用程序,当我点击在EDITTEXT键盘打开和隐藏的动作条。我不希望这样的事情发生,我怎么能解决这个问题?这是由谷歌联系人应用程序的平板电脑为例做了。

In my Android application running in a XOOM device, when I click in an Edittext the keyboard opens and hides the Actionbar. I don't want this to happen, how can I solve this? This is done by the Google Contacts app for the tablet for example.

编辑: 我在其中用户需要FO填充几个edittexts。首先,当用户点击上的一个的EditText底部,键盘显示和隐藏在其中用户打字的EditText上,所以他不能看到他打字。我发现它真的很糟糕,并解决它,我只是添加到清单:安卓windowSoftInputMode =stateVisible | adjustPan 但在那之后,现在屏幕调整itselfs和隐藏操作栏。

I have several edittexts in which the user needs fo fill. At first, when the user clicked on one edittext on the bottom, the keyboard showed up and hide the edittext in which the user was typing, so he couldn't see what he was typing. I found it really bad, and to solve it I just added to the manifest: android:windowSoftInputMode="stateVisible|adjustPan" But after that, now the screen adjust itselfs and hides the action bar.

在谷歌联系人应用程序不相同,但奇迹般地没有隐藏操作栏。他们是怎么做到的呢?

The Google Contacts app does the same, but it magically doesn't hide the Action bar. How do they do it?

推荐答案

使用 adjustResize ,而不是 adjustPan 的。该框架将始终尽量保持屏幕上的焦点元素通过滚动任何家长的意见,如果有必要的。

Use adjustResize instead of adjustPan. The framework will always try to keep the focused element on-screen by scrolling any parent views if necessary.

如果没有嵌套你的EditText字段在某种滚动容器,如滚动型那么你的布局可能会太高,无法完全显示当键盘重新调整你的活动。试试你的包装形式的布局在滚动型。这也将让如果是小屏幕设备,其中也可能有类似的问题上运行你的应用程序的内容进行滚动。

If your EditText field is not nested in some sort of scrolling container such as a ScrollView then your layout may be too tall to completely display when the keyboard resizes your activity. Try wrapping your form's layout in a ScrollView. This will also allow your app's content to scroll if it is running on a smaller screen device where it may have similar issues.

这篇关于键盘布局隐藏Android的动作吧?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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