slide screen up with keyboard

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
witeowl
Posts: 45
Joined: Mon Feb 21, 2011 3:02 am

slide screen up with keyboard

Post 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.
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: slide screen up with keyboard

Post 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
witeowl
Posts: 45
Joined: Mon Feb 21, 2011 3:02 am

Re: slide screen up with keyboard

Post 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!
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: slide screen up with keyboard

Post 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
dburdan
Posts: 104
Joined: Fri Jan 28, 2011 5:39 am

Re: slide screen up with keyboard

Post 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.
joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: slide screen up with keyboard

Post 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
Klaus
Posts: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: slide screen up with keyboard

Post 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
joel.epsteinBUS31vi
Posts: 135
Joined: Thu Sep 13, 2012 10:25 pm

Re: slide screen up with keyboard

Post by joel.epsteinBUS31vi »

Fantastic. Just what I needed. Thanks so much.

Joel
Post Reply