Keyboard in IOS and Field Focus

Dave Kilroy dave at applicationinsight.com
Wed Nov 6 12:26:34 EST 2013


Hi Vaughn

In general on iOS I try to keep using LiveCode fields rather than going for
native fields - I then have lots of functionality I'm used to - but do have
to spend time making the field look pretty...

So this is what I do:

1 - In my text entry field I make sure that 'TraversalOn' is set
2 - In the script of the field's card I have keyboardActivated and
keyboardDeactivated handlers to catch the LiveCode messages and inside these
I can call other handlers to move fields up and back down again catering for
the keyboard
3 - Using the 'effective screenRect' provides the area of the app not taken
up by the keyboard (when active) which you can use to calculate where to
move the text entry field and other stuff to
4 - In the field's script I'll also have a returnInField handler where I can
'set the focus to nothing' to dismiss the keyboard (and can also 'set the
focus to nothing' in a mouseDown handler in the card

And that's about it really - I do some other stuff in resizeStack to check
if the keyboard is showing so that the app can change orientation gracefully
with the keyboard up if the user rotates the device - and I think the final
thing to watch out for is to return everything to its proper place if the
user opened the keyboard in portrait orientation and closed it in landscape

Does this help? If not then please clarify...

Dave



-----
"Some are born coders, some achieve coding, and some have coding thrust upon them." - William Shakespeare & Hugh Senior

--
View this message in context: http://runtime-revolution.278305.n4.nabble.com/Keyboard-in-IOS-and-Field-Focus-tp4671935p4671948.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list