Way to be notified when the software keyboard is showing/hiding?

前端 未结 2 1076
猫巷女王i
猫巷女王i 2021-01-06 19:51

Is there a way to be notified when the keyboard is about to show, or has shown? The following events would be great:

keyboardWillShow keyboardDidShow keyboardWillHi

2条回答
  •  说谎
    说谎 (楼主)
    2021-01-06 19:53

    As MatrixFrog mentioned you can use the Activity's onCofigurationChanged method. With that you have keyboardWillShow and keyboardWillHide.

    To get the other two you can try using one of the InputMethodManager's methods but I don't think a callback like that exists.

提交回复
热议问题