Getting the dimensions of the soft keyboard

后端 未结 11 760
故里飘歌
故里飘歌 2020-11-27 14:56

Is there a way to know the size of the keyboard that is shown in the screen?

I am using Cocos2dx for programming, but I want to know the height of the keyboard shown

11条回答
  •  萌比男神i
    2020-11-27 15:03

    If you want to calculate the Virtual Keyboard height while your activity does not change in size (adjustPan) then you can use this sample:

    https://github.com/siebeprojects/samples-keyboardheight

    It uses a hidden window in order to calculate the height difference between the window and the root view of the activity.

提交回复
热议问题