简体   繁体   English

使用屏幕键盘触摸事件

[英]Touch events with onscreen keyboard

I have an Android app with a touch listener that detects touch events to my app. 我有一个带有触摸侦听器的Android应用,该应用可以检测我的应用的触摸事件。 This works fine for areas within my app, but when the on screen keyboard is activated that the user touches it, I don't get these touch events. 这对于我的应用程序中的某些区域效果很好,但是当激活屏幕键盘以使用户对其进行触摸时,我不会收到这些触摸事件。 Is it possible to obtain these touch events as well? 是否有可能获得这些触摸事件?

On a related note, what type of View element are on screen keyboards? 相关说明,屏幕键盘上的View元素类型是什么? Are they system overlays? 它们是系统叠加层吗?

You can use 您可以使用

android:windowSoftInputMode="adjustPan" 

or 要么

android:windowSoftInputMode="adjustResize" 

It will move your layout above the keyboard or resize it respectively. 它将在键盘上方移动您的布局或分别调整其大小。

Hope it helps. 希望能帮助到你。

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

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