获取Android中虚拟键盘的高度 [英] Get the height of virtual keyboard in Android

查看:42
本文介绍了获取Android中虚拟键盘的高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android中获取虚拟键盘的高度?可能吗?

How can I get the height of virtual keyboard in Android? Is it possible?

我尝试从主窗口获取它,但它提供了应用程序的完整高度.但我想获得键盘高度.

I try to get it from the main window, but it gives me full height of the application. But I want to get the keyboard height.

推荐答案

你不能得到键盘高度,但是你可以得到你的 View 的高度,这才是你真正想要的——你会得到这个数据提供给当前视图的 onLayout 调用.

You can't get the keyboard height, but you can get the height of your View, which is what you really want - and you'll get this data supplied to the onLayout call into the current view.

这篇关于获取Android中虚拟键盘的高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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