Detailed example of Android monitoring soft keyboard status

Detailed example of Android monitoring soft keyboard status

Recently, I encountered the problem of detecting whether the soft keyboard is displayed or hidden. I searched the Internet and finally found a very simple one to record.

Activityroot is the root view of activity, which is the first view in XML. Set it with an ID

But this depends on Android: windowsoftinputmode = "adjustresize",

If it is adjustpan, it is useless if the activity height remains unchanged. Then I finally found a method that can be used with the same interface height. This method can't monitor, but can only take the initiative to query, but I just need it

If you have any questions, please leave a message or go to the community of this site for exchange and discussion. Thank you for reading. I hope it can help you. Thank you for your support to this site!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>