如何在横向模式下只打开半键盘?

How to open only half keyboard in Landscape mode?(如何在横向模式下只打开半键盘?)
本文介绍了如何在横向模式下只打开半键盘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

问题描述

我想开发一款基于 Android 打字的游戏.我真的希望这款游戏能够在横向模式下运行,因为在我看来,它是更具体的 Android 游戏.

I want to develop an Android typing based game. I would really want this game to work on landscape mode, because, in my opinion, it is more specific Android games.

这是第一个问题

如果我切换横向模式,当用户打开键盘时,他看不到屏幕的其余部分,因为在横向模式下它会打开全屏.(我的键盘就是这样做的)

if I toggle landscape mode, when the user opens the keyboard he can not see the rest of the screen because in Landscape Mode it opens Full Screen. (my keyboard does this)

问题:有什么方法可以让我在横向模式下只打开半个键盘,这样用户就可以看到他在哪里打字,或者有没有人找到解决这个问题的其他方法?

Question: Is there any way in which I can open only half keyboard in Landscape Mode so that the user can see what where he is typing or does anyone find another way to solve this problem?

非常感谢!

推荐答案

添加这个:

android:imeOptions="flagNoExtractUi"

到您的 EditText 节点(在 xml 中)将使键盘在屏幕的一半上弹出,并允许您在文本字段中(在您的 UI 中)而不是在其自身(全屏)中编辑文本文本编辑区.

to your EditText node (in the xml) will make it so that the keyboard pops up on half the screen and lets you edit the text right IN the text field (in your UI) rather than in its own (full screen) text edit area.

我刚刚在 Galaxy Nexus(运行 ICS)和 RAZR Maxx(运行 Gingerbread)中对此进行了测试,该应用是为 midSdk 10 (2.3.3) 编译的.它似乎有效.

I've just tested this in a Galaxy Nexus (running ICS) and a RAZR Maxx (running Gingerbread), the app is compiled for midSdk 10 (2.3.3). It appears to work.

这篇关于如何在横向模式下只打开半键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Android release APK crash with java.lang.AssertionError: impossible in java.lang.Enum(Android 发布 APK 因 java.lang.AssertionError 崩溃:在 java.lang.Enum 中不可能)
Finished with Non Zero Exit Value 3(以非零退出值 3 结束)
On gradle:3.0.0 More than one file was found with OS independent path #39;META-INF/ASL2.0#39;(在 gradle:3.0.0 上找到多个文件,其独立于操作系统的路径为“META-INF/ASL2.0)
Android : app loading library at runtime on Lollipop but not IceCreamSandwich(Android:运行时在 Lollipop 上而不是 IceCreamSandwich 上的应用程序加载库)
buildConfigField depending on flavor + buildType(buildConfigField 取决于风味 + buildType)
How do I suppress warnings when compiling an android library with gradle?(使用 gradle 编译 android 库时如何抑制警告?)