Page 1 of 1

slide screen up with keyboard

Posted: Sat Apr 02, 2011 10:22 pm
by witeowl
I have a card with a number of editable fields. Some of them are hidden when the keyboard comes up. The ideal solution would be to have the screen slide up so that the active field is still visible just above the keyboard, and then slide back down then the keyboard slides away, but I have no idea where to start.

Suggestions?

An alternate solution is to use the ask command, defaulting to the field's current contents, but then I'd like to be able to control the keyboard type, and I can't seem to find a way to do so with ask.

Suggestions on either would be welcome.

Re: slide screen up with keyboard

Posted: Sat Apr 02, 2011 11:03 pm
by Klaus
Hi whiteowl,

can't you group these fields and move the group up and
down again after the user has entered text?


Best

Klaus

Re: slide screen up with keyboard

Posted: Sat Apr 02, 2011 11:33 pm
by witeowl
Huh. Is it really that simple? It won't be a problem that some of the items go past the bounds of the card? Jeez, I was afraid I'd have to be facing the nightmare I struggled through with my first iOS scroller, but you make it sound quite simple.

OK, I'll play with it. Thanks.

EDIT: Yup, it really was that simple. No nightmares at all. Thanks again!

Re: slide screen up with keyboard

Posted: Sun Apr 03, 2011 12:10 pm
by Klaus
Hi whiteowl,

well, most of the time it is that smple with LiveCode 8)

You can catch the "keyboardDeactivated" message to move
your group back to its original location after text input!


Best from germany

Klaus

Re: slide screen up with keyboard

Posted: Mon Apr 04, 2011 12:25 am
by dburdan
If you measure the height of the keyboard you can offset your group by that amount. By using AE, you can probably add a nice slide effect. Then, on the keyboardDeactivated message, reset the the position with a nice slide effect.

Re: slide screen up with keyboard

Posted: Tue Dec 02, 2014 9:06 pm
by joel.epsteinBUS31vi
Now that there are a bazillion different screen sizes, is there a handy way to measure the keyboard height? I'd like to do the sliding effect described below, but need to know how far to slide, based on what device the app is running on. If I could measure the height of the keyboard, it would be a snap.

Any suggestions?

I'd be ever so grateful for any advice.

Peace.

Joel

Re: slide screen up with keyboard

Posted: Tue Dec 02, 2014 10:06 pm
by Klaus
Hi Joel,

you can check "the effective screenrect" after the keyboard has popped up and do some calculations :D

From the docs about "screenrect":
...
Adding the effective adjective to either form returns the area of the screen the application has to itself.
In particular, if the keyboard is activated, it take into account if the keyboard is taking up space on the screen.
(Android and iOS only)
...

Best

Klaus

Re: slide screen up with keyboard

Posted: Wed Dec 03, 2014 1:30 am
by joel.epsteinBUS31vi
Fantastic. Just what I needed. Thanks so much.

Joel