如何使用Delphi在Android中检测虚拟键盘事件 [英] How to detect Virtual Keyboard Events in Android with Delphi

查看:220
本文介绍了如何使用Delphi在Android中检测虚拟键盘事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用带有Delphi的Rad studio Xe5开发一个Android应用,并且遇到以下问题:

I'm trying to develop an Android app with Rad studio Xe5 with Delp and i having the following problem:

在屏幕底部有一个Tmemo,在按下它以键入一些文本时,虚拟键盘显示在Tmemo上,我看不到.我想在显示键盘上检测到该事件,然后移动该Tmemo的位置.隐藏虚拟键盘时,我将执行相同的操作,并将Tmemo恢复到其原始位置.有人知道在键盘上显示和隐藏事件时很热吗?

There is a Tmemo, which is at the bottom of the screen, and at the time of pressing it for typing some text, the virtual keyboard is showed over the Tmemo which i can't see. I would like to detect the event on show keyboard and move change the position of that Tmemo. I will do the same when the Virtual Keyboard is hide, and bring back the Tmemo to his original position. Does anybody know hot to detect the event on keyboard show and hide?

最好的问候

推荐答案

您可以使用它来隐藏键盘,

You can use this to hide the keyboard,

private InputMethodManager mKeyboard;
    mKeyboard = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
    mKeyboard.hideSoftInputFromWindow(countryTo.getWindowToken(), 0);

这篇关于如何使用Delphi在Android中检测虚拟键盘事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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