Keyboard covers text field when typing

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Keyboard covers text field when typing

Post by ECNU4271 » Mon Aug 26, 2013 11:37 pm

Hi all,

When user wants to type, the keyboard goes up and it occupies half of the screen which will cover some text fields users may want to type.

That makes users blind on what they are typing.

Is there good way to solve problem?

I do think it's a common one so there should be someone who has asked this before. :D

Thanks!
Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Mon Aug 26, 2013 11:41 pm

Hi Michael,
Again it's get the effective working screenRect
Please look screenRect in the dictionary and then try it when the keyboard is up.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: Keyboard covers text field when typing

Post by ECNU4271 » Tue Aug 27, 2013 12:19 am

Simon wrote:Hi Michael,
Again it's get the effective working screenRect
Please look screenRect in the dictionary and then try it when the keyboard is up.

Simon
Hey, Simon

Thanks, I've looked up screenRect in the dictionary

I tried:

Code: Select all

on openCard
set the rect of this stack to line 9 of the working screenRects
end openCard
Somehow it doesn't work.
What will be the correct way to use the command anyway?

Michael

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Keyboard covers text field when typing

Post by Jellicle » Tue Aug 27, 2013 12:24 am

Ignore screenRects. You have to implement a way for the fields to move upwards when the keyboard is visible. There are a few ways of doing that depending on how many fields there are and how high they are. Can you tell us more about the layout of the fields on the screen?

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: Keyboard covers text field when typing

Post by ECNU4271 » Tue Aug 27, 2013 12:26 am

Hi, Gerry,

There will be 6 fields up to down across the screen averagely.
The keyboard occupies about 40% of the screen.

Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Tue Aug 27, 2013 12:26 am

errr Gerry,
effective working screenRects tells you how far you have to move the field. :)

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Tue Aug 27, 2013 12:29 am

And Micheal,
You can't set the screenRect on mobile.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: Keyboard covers text field when typing

Post by ECNU4271 » Tue Aug 27, 2013 12:32 am

Simon wrote:And Micheal,
You can't set the screenRect on mobile.

Simon
Then what should I do?

Any easy way to do it? Because I only have little time before Deadline and if it doesn't work I would just leave it there as future improvement.

Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Tue Aug 27, 2013 12:42 am

Well if you have the effective blah blah and you group your field into a scrolling group you can set the vScroll of the group.
Fun!

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: Keyboard covers text field when typing

Post by ECNU4271 » Tue Aug 27, 2013 12:46 am

Simon wrote:Well if you have the effective blah blah and you group your field into a scrolling group you can set the vScroll of the group.
Fun!

Simon
Well, Simon...
It seems I am not able to do that....
Could you please teach or show me to some extent?

Thank you,
Michael

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Tue Aug 27, 2013 12:52 am

Maybe I should have done this:

Code: Select all

get the effective working screenRect
answer it
Put that into 1 of your fields, I see you know textChanged so put it in that.
Also add a button that you can use when the keyboard is not showing and put the code into that. See the difference?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ECNU4271
Posts: 93
Joined: Tue May 07, 2013 4:33 pm

Re: Keyboard covers text field when typing

Post by ECNU4271 » Tue Aug 27, 2013 1:16 am

sorry Simon, I was busying coding other functions of my app and forgetting you're waiting... Sorry!!

Let me try it now

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Tue Aug 27, 2013 1:20 am

Actually I'm not waiting for you.
I don't work here.

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: Keyboard covers text field when typing

Post by Jellicle » Tue Aug 27, 2013 8:23 am

Simon wrote:Maybe I should have done this:

Code: Select all

get the effective working screenRect
answer it

Putting that in a button on a card where the keyboard is used with native input controls I get "0,40,640,920" when it's visible, and "0,40,640,1136" when it isn't (for an iPhone 5 screen).

Is that the expected behaviour? If so...it's wrong :) The rect of the area still visible above the keyboard is smaller than "0,40,640,920" :)

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Keyboard covers text field when typing

Post by Simon » Tue Aug 27, 2013 8:48 am

Well that's cool that you could measure it!
Are you adding the title bar?

Simon
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

Post Reply