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

2023-01-30移动开发问题
4

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

问题描述

我想开发一款基于 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.

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

The End

相关推荐

从 Documents 目录存储和读取文件 iOS 5
Storing and reading files from Documents directory iOS 5(从 Documents 目录存储和读取文件 iOS 5)...
2024-08-12 移动开发问题
9

如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?
How can i use MYSQL database connection in iphone application useing cocos2d?(如何在使用 cocos2d 的 iphone 应用程序中使用 MYSQL 数据库连接?)...
2024-08-12 移动开发问题
5

在 cocos2d 中平滑拖动一个 Sprite - iPhone
Smoothly drag a Sprite in cocos2d - iPhone(在 cocos2d 中平滑拖动一个 Sprite - iPhone)...
2024-08-12 移动开发问题
10

CCScrollView 滚动和触摸事件永远不会触发
CCScrollView scroll and touch events never firing(CCScrollView 滚动和触摸事件永远不会触发)...
2024-08-12 移动开发问题
1

使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘
removing jagged edges of my ropes using antialiasing of OpenGLES(使用 OpenGLES 的抗锯齿去除绳索的锯齿状边缘)...
2024-08-12 移动开发问题
34

cocos2d 在场景之间移动
cocos2d Moving between scene(cocos2d 在场景之间移动)...
2024-08-12 移动开发问题
2