Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the height of the softkeyboard in Adobe AIR Mobile

We're trying to plan out a mobile AIR application that will deploy to both Android and iOS. One of the screens our design team has returned is a fullscreen text editor that runs from the top of the screen to the keyboard. I obviously cannot do this if I cannot grab the height of the keyboard programatically. Is there a way to do this?

I know that it is possible in iOS and it appears to be impossible in Android. I have no issue creating an ANE to do it, but I would rather avoid it if the data is already available in AIR. Alternatively, I could just assume that the keyboard is 1/2 the size of the screen and this would work, for the most part, on iOS just fine.

In short, is getting the height of the softkeyboard possible in AIR?

like image 489
Josh Avatar asked Dec 13 '12 23:12

Josh


1 Answers

I believe you can access it using the stage class. Take a look at this.stage.softKeyboardRect within your view.

Note: I have not tried this personally, but you may need to access it after a softkeyboard event. Add an event listener to your text input on softKeyboardActivate, then call this.stage.softKeyboardRect to get the height and position of the keyboard.

like image 137
Colin Avatar answered Oct 18 '22 11:10

Colin