[英]Soft keyboard button
我的問題很簡單。 我只需要知道關閉鍵盤按鈕會產生什么事件即可。 我想監聽事件並在捕獲事件時執行一個簡單的方法...我搜索了很多問題,但是我嘗試的所有解決方案都針對其他關鍵事件。
我之前對此進行了研究,並且一直在不停地進行對話,而人們則說沒有這樣的事件可以捕捉。
不確定您要捕獲此事件的目的是什么,但是這里有一些解決方法對我有所幫助:
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
final int proposedheight = MeasureSpec.getSize(heightMeasureSpec);
final int actualHeight = getHeight();
if (actualHeight > proposedheight){
// Keyboard is shown
} else {
// Keyboard is hidden
}
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
來源 。 讓我知道是否有幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.