Greetings:
I have an iPad screen which has text entry fields in the lower half of the screen.
I found a forum post which suggested using on the 'on keyboardActivated' handler to move the text areas to the top of the screen when the keyboard was present in the lower half.
This works quite nicely, except...
It's possible to tap the screen between the text entry fields, and this seems to fire the 'on keyboardDeactivated' handler. My code moves my text fields back to the lower half of the screen ... *BUT* the keyboard remains.
When I tap the bottom right key to remove the keyboard, the 'on keyboardDeactivated' handler fires a second time.
For me, this is a bit messy, because I have other fields in the top half which I fade out and move off-screen before moving the other text fields to the top. And then I move the top fields back and fade them in once the other fields have been moved to the bottom. So, when the keyboardDeactivated handler fires the second time, my top fields fade out and in.
I'm guessing there's no way to know the keyboard is on-screen, as opposed to activated?
TIA
--paul
keyboardDeactivated oddity...
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: keyboardDeactivated oddity...
Post your code...
Dixie
Dixie
-
- Posts: 125
- Joined: Sat Jan 31, 2009 12:01 am
Re: keyboardDeactivated oddity...
I built the fields for text entry to be above the keyboard line, just to avoid this type of situation.
Re: keyboardDeactivated oddity...
Hi Paul,
I see why Dixie was so blunt.
Seems to me in your 'on keyboardDeactivated' handler you added some code to fix the problem of switching between fields throwing a false 'on keyboardDeactivated' which it does here.
Now just testing with two fields on a card, tapping outside a text fld takes the focus away from the field and the keyboard goes away. UNLESS you are tapping on an non focusable object (e.g. image)(i.e. no keyboardDeactivated message). Maybe the answer for you is to place an image behind the fields.
Simon
I see why Dixie was so blunt.
Seems to me in your 'on keyboardDeactivated' handler you added some code to fix the problem of switching between fields throwing a false 'on keyboardDeactivated' which it does here.
Now just testing with two fields on a card, tapping outside a text fld takes the focus away from the field and the keyboard goes away. UNLESS you are tapping on an non focusable object (e.g. image)(i.e. no keyboardDeactivated message). Maybe the answer for you is to place an image behind the fields.
Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: keyboardDeactivated oddity...
Thanks for all the comments.
I didn't post my code because there's a lot of it, and I really should take the time to strip it down to see why I am getting this odd keyboard behavior. But, to be honest, this isn't really a major issue for me... I just find it strange.
My question really was in my last line:
I'm guessing there's no way to know the keyboard is on-screen, as opposed to activated?
...and I'm still guessing the answer is 'no'.
Simon: Yes, maybe an image behind the fields is a workaround. Thanks for that.
--paul
I didn't post my code because there's a lot of it, and I really should take the time to strip it down to see why I am getting this odd keyboard behavior. But, to be honest, this isn't really a major issue for me... I just find it strange.
My question really was in my last line:
I'm guessing there's no way to know the keyboard is on-screen, as opposed to activated?
...and I'm still guessing the answer is 'no'.
Simon: Yes, maybe an image behind the fields is a workaround. Thanks for that.
--paul
Re: keyboardDeactivated oddity...
Paul,
You are correct, with the few tests I made, currently you can get many false triggers thrown.
It is almost true that if a editable text field has focus then the keyboard is up, until the soft keyboard down key is hit.
Simon
You are correct, with the few tests I made, currently you can get many false triggers thrown.
It is almost true that if a editable text field has focus then the keyboard is up, until the soft keyboard down key is hit.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!