Page 1 of 1

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

Posted: Wed Sep 14, 2011 1:16 pm
by JosepM
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

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

Posted: Wed Sep 14, 2011 4:28 pm
by Klaus
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