简体   繁体   English

Android屏幕键盘和B4A

[英]Android on-screen keyboard and B4A

I am wondering about the on-screen keyboard (osk). 我想知道屏幕键盘(osk)。

When I'm in portrait mode the osk shows up on the bottom of the screen and only covers up the lower portion of my app. 当我处于纵向模式时,osk显示在屏幕的底部,只覆盖我应用程序的下半部分。 This is ideal because you can still see my text box which is located in the upper portion of the app. 这是理想的,因为您仍然可以看到位于应用程序上部的文本框。 But when the orientation is changed to landscape, the osk covers up the entire app (hiding my text box) with its own text area. 但是当方向更改为横向时,osk将使用自己的文本区域覆盖整个应用程序(隐藏我的文本框)。

This osk text area only shows in landscape mode. 此osk文本区域仅以横向模式显示。 Is this how the osk behaves on all Androids or is it specific to Samsung Tab 7" or something else? 这是osk在所有Androids上的表现方式,还是特定于三星Tab 7“或其他什么?

Is there a way to prevent the osk from displaying its own text box in landscape mode? 有没有办法阻止osk在横向模式下显示自己的文本框? If not, I will have to design my own osk. 如果没有,我将不得不设计自己的osk。 If I do design my own osk can I still take advantage of Android's auto completion through B4A? 如果我设计自己的osk,我仍然可以通过B4A利用Android的自动完成功能吗?

I have tried the AutoCompleteEditText but it does not work the way that the Android auto completion does which is closer to what I need. 我已经尝试过AutoCompleteEditText,但它不能像Android自动完成那样接近我需要的方式。

Any suggestions? 有什么建议么?

Thank you for your help, 谢谢您的帮助,

Bob Gately Bob Gately

Better answer. 更好的答案。 You can use the reflection library to disable the full screen keyboard: 您可以使用反射库来禁用全屏键盘:

Dim r As Reflector
r.Target = EditText1
r.RunMethod2("setImeOptions", 268435456, "java.lang.int") 'IME_FLAG_NO_EXTRACT_UI constant

This is the default behavior of all Androids when in landscape. 这是所有Androids在横向时的默认行为。 You may want to see this link for an implementation of custom keyboards: 您可能希望看到此链接以实现自定义键盘:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM