Getting the dimensions of the soft keyboard

后端 未结 11 754
故里飘歌
故里飘歌 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条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-27 15:09

    You can't tell. No, really: you simply can't tell.

    The keyboard does not need to be any particular shape. It does not have to be placed at the bottom of the screen (many of the most popular options are not), it does not have to keep its current size when you change text fields (almost none do depending on the flags). It does not even have to be rectangular. It may also just take over the entire screen.

提交回复
热议问题