I'm trying to move my control to avoid the keyboard to cover it so i write this script in the stack but it don't seems to work:
Code: Select all
on keyboardActivated
if the environment is "mobile" then
if mobileControlTarget() is "numeroAMob" then
put the rect of field "numero_A" into rectNumero_A
set itemdelimiter to ","
put rectNumero_A into trectPROVV
put the item 2 of rectNumero_A into tTOP
subtract 20 from tTOP
put the item 4 of rectNumero_A into tBOTTOM
subtract 20 from tBOTTOM
put tTop into item 2 of trectPROVV
put tBOTTOM into item 4 of trectPROVV
mobileControlSet "numeroAMob", "rect", trectPROVV
end if
end if
end keyboardActivated
on keyboardDeactivated
if the environment is "mobile" then
mobileControlSet "numeroAMob", "rect", rectNumero_A
end if
end keyboardDeactivated
How can i move the control only when the focus is in it?
Is there a more elegant way to avoid the keyboard to cover? Can i shift up the entire card? so my control don't go over others?