How to move the content that is located under the keyboard?

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
JosepM
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 344
Joined: Tue Jul 20, 2010 12:40 pm

How to move the content that is located under the keyboard?

Post by JosepM » Wed Sep 14, 2011 1:16 pm

Hi,

I'm blocked with this and no idea how solve.

I have many fields on a card but when touch the last ones, on the bottom of the screen, the keypad appear over the fields :( How move or what solution to move these fields up?

Info from the developer page...

http://developer.apple.com/library/ios/ ... ement.html

Any experience or idea?

Salut,
Josep

Klaus
Posts: 14182
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: How to move the content that is located under the keyboard?

Post by Klaus » Wed Sep 14, 2011 4:28 pm

Hi Josep,

I ususally use two custom properties for each object that is supposed to be at different locs at different times.

Try this:
1. Note the original loc, the one that gets covered by the virtual keyboard, (Inspector: Size and Position) of your field(s)
2. Create a custom property for your field, name it cOriginalLoc and set its value to the loc of the field, as noted in 1.: x,y
3. Now move your field to a position that is NOT coverd by the virtual keyboard and note this new loc, too.
4. Create another custom property for your field, name it cEditLoc and set its value to the new loc, as noted in 3.

Now add this script to your field:

Code: Select all

## Start editing, move to EDIT location:
on focusin
  set the loc of me to the cEditLoc of me
end focusin

## Stop editing, move back to original position:
on focusout
  set the loc of me to the cOriginalLoc of me
end focusout
This is out of my head, but should work, you get the picture :D

Best

Klaus

Post Reply