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.
这篇关于如何在横向模式下只打开半键盘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在横向模式下只打开半键盘?
基础教程推荐
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- iOS4 创建后台定时器 2022-01-01
