-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This will not work on <renderMode>direct</renderMode> #1
Comments
@gilamran I got the same problem. Did you find a solution how to get the correct soft keyboard size? |
That was more than a year ago... I don't remember sry. |
I have the same problem. Rendering in direct and on SOFT_KEYBOARD_ACTIVATE the value for Height is 0 and for Y is [fullScreenHeight], so basicly always like it were hidden. I thought this ANE solved exactly this problem? I'm confused. EDIT: What i just noticed is, that while I use getKeyboardHeight() on SOFT_KEYBOARD_ACTIVATE is always giving me 0, when I wait 200-1000ms and recheck the value, it actually gives me a usefull value back. Therefore a workaround for now could be to tween the Input-Textfield intoplace and onComplete recheck the height in hope that now correct values are available. |
In our case, there were actually two problems on Android. The first one was the one you just mentioned. The second one was that when setting setSoftInputMode to 48 (adjust nothing), the value for height would always be 0, even after some timeout. Though, when setting setSoftInputMode to 32 (pan) and waiting for some frames, So our workaround now is to temporarily set the setSoftInputMode to 32 (pan) right after the softkeyboard activate event, and to move the StageText in the visible area so that no pan occurs. We also cache the height value for every input type so that we only have to do this procedure once per app lifecycle. |
Looks like a good workaround. What value did you use for , and what do you mean by "to move the StageText in the visible area so that no pan occurs"? |
Ah, some text disappeared. It should say "What value did you use for softKeyboardBehavior (in the application description xml)." |
softKeyboardBehavior was set to "none" When the input is not hidden by the keyboard then the screen does not pan, even when setSoftInputMode is changed to 32 (pan) instead of 48 (none). So by "move the StageText in the visible area" I meant: set the y coordinate of the input to a value that puts the input in the upper half of the screen which will most likely not be hidden by the keyboard. |
Great! And does this work for both Android and iOS? Since iOS returns a correct value for softkeyboardrect (well, before iPhone 6...). What I mean is can we trust the change in height (I presume you mean the MeasureKeyboard.getInstance().getKeyboardHeight();?) will always take place, or should we check if it is not 0? |
We did not use this ANE to get the keyboard height on iOS, only on Android. In the source of this ANE you'll see that it will always return "null" on iOS.
|
OK, great. I’ll check if it is Android. and will use this method, when it is. Otherwise, I will use softKeyboardRect. Although I am not sure if it will return the correct value on the iPhone 6. Thanks, and I will report back if this works.
|
And reporting back. It works! Thanks!
|
Most of the apps/games these days use Starling, so they all use direct mode, and not auto (cpu). When using direct I get size 0 all the time.
The text was updated successfully, but these errors were encountered: