iOS Keyboard covers text area

45 views
Skip to first unread message

nickk...@gmail.com

unread,
Mar 5, 2018, 4:41:22 PM3/5/18
to CodenameOne Discussions
I have a BoxLayout Y with a variable number of Containers in it. It is scrollableY and can have 10 or so Containers each one have some buttons and a TextArea. On Android when you edit the bottom TextArea the screen resizes and you can see what you are typing, on iOS it does not and the TextArea remains under the keyboard.

How am I supposed to layout this to make it work on iOS correctly?




Shai Almog

unread,
Mar 6, 2018, 12:00:21 AM3/6/18
to CodenameOne Discussions
The behavior on iOS is generally better for most cases as the scroll area grows. There are some edge cases (more on Android) where things misbehave and we need test cases so we can eliminate them. If you can isolate this to a test case that would help in tracking it down.

nickk...@gmail.com

unread,
Mar 19, 2018, 12:08:10 AM3/19/18
to CodenameOne Discussions
public class Main {
    private Form current;
    private Resources theme;
    public void init(Object context) {
        theme = UIManager.initFirstTheme("/theme");
        // Enable Toolbar on all Forms by default
        Toolbar.setGlobalToolbar(true);
        // Pro only feature, uncomment if you have a pro subscription
        // Log.bindCrashProtection(true);
    }
    Form hi;
    public void start() {
        if(current != null){
            current.show();
            return;
        }
        
        
hi = new Form("Welcome", new BoxLayout(BoxLayout.Y_AXIS));
for(int i = 0; i < 20; i++){
hi.add(new TextField());
}
 
        hi.show();
    }
    
    public void stop() {
        current = Display.getInstance().getCurrent();
        if(current instanceof Dialog) {
            ((Dialog)current).dispose();
            current = Display.getInstance().getCurrent();
        }
    }
    
    public void destroy() {
    }
}

This example seems to show the error as well and is as minimal as I can get with it.

Shai Almog

unread,
Mar 19, 2018, 1:28:44 AM3/19/18
to CodenameOne Discussions
You should be able to scroll to the editing text field in this case.
If I understand correctly this happens only on opening the VKB for the first time.

Is this consistent? E.g clicking the 12th text field always triggers this.

On which device?
Which OS version?

nickk...@gmail.com

unread,
Mar 19, 2018, 7:56:04 PM3/19/18
to CodenameOne Discussions
Yes, anything after the 6th text box will be covered by the keyboard when it opens, you can scroll to see some but it springs back when take your finger off to start typing.
iPhone 6s
iOS 11.2.6 but had users with older version report this issue too.

What were your findings from running the minimal example? is there a device / OS version combination that DOES work or should it be a fix in either the layout in the app or CN1 itself?

Shai Almog

unread,
Mar 20, 2018, 12:56:05 AM3/20/18
to CodenameOne Discussions
Odd, I'll try to reproduce this. Can you file an issue?

Steve Hannah

unread,
Mar 20, 2018, 12:21:56 PM3/20/18
to codenameone...@googlegroups.com
I'm unable to reproduce this issue on iPhone 6S running 11.1.2 or with Xcode simulator iPhone 6S 11.2

Have you tried this on the latest builds?  There was a change 15 days ago that may have affected this use case (in a good way).

Best regards

Steve

On Mon, Mar 19, 2018 at 9:56 PM, Shai Almog <shai....@gmail.com> wrote:
Odd, I'll try to reproduce this. Can you file an issue?

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/4c752f94-a962-422a-9a84-68eda1e42060%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
Steve Hannah
Software Developer
Codename One

nickk...@gmail.com

unread,
Mar 20, 2018, 4:58:28 PM3/20/18
to CodenameOne Discussions
Hi Steve,

This build was made 2 days ago. Are you running it from the build server? How do you test on the xcode simulator?

Cheers,
Nick

Steve Hannah

unread,
Mar 20, 2018, 5:02:37 PM3/20/18
to codenameone...@googlegroups.com
On Tue, Mar 20, 2018 at 1:58 PM, <nickk...@gmail.com> wrote:
Hi Steve,

This build was made 2 days ago. Are you running it from the build server?
Yes.  Was your build using the test case the you posted?  Because that's what I was using.
 
How do you test on the xcode simulator?
Include sources, then build with Xcode.

Steve 

Cheers,
Nick


On Wednesday, March 21, 2018 at 5:21:56 AM UTC+13, Steve Hannah wrote:
I'm unable to reproduce this issue on iPhone 6S running 11.1.2 or with Xcode simulator iPhone 6S 11.2

Have you tried this on the latest builds?  There was a change 15 days ago that may have affected this use case (in a good way).

Best regards

Steve
On Mon, Mar 19, 2018 at 9:56 PM, Shai Almog <shai....@gmail.com> wrote:
Odd, I'll try to reproduce this. Can you file an issue?

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.

nickk...@gmail.com

unread,
Mar 20, 2018, 8:19:12 PM3/20/18
to CodenameOne Discussions
Hi,

Rebuilt this same test case in the past couple of hours and run on 2 different devices and the Simulator all showing the problem. But I think I see where the confusion is. You can edit the last text area on the screen (the 12th on an iPhone 6) and it will scroll into view fine but there are 20 text areas in this example - if you scroll to the bottom of the container then you can't see while editing any of the last 6 text areas as they are under the keyboard and the container doesn't adjust to manage this.

Hope that helps find a solution - it could be the way the container is set up so an issue with the way CN1 handles the keyboard in these cases.

Obviously works find on Android as the screen is resized to suit and the keyboard is below the bottom of the list.



On Wednesday, March 21, 2018 at 10:02:37 AM UTC+13, Steve Hannah wrote:
On Tue, Mar 20, 2018 at 1:58 PM, <nickk...@gmail.com> wrote:
Hi Steve,

This build was made 2 days ago. Are you running it from the build server?
Yes.  Was your build using the test case the you posted?  Because that's what I was using.
 
How do you test on the xcode simulator?
Include sources, then build with Xcode.

Steve 

Cheers,
Nick


On Wednesday, March 21, 2018 at 5:21:56 AM UTC+13, Steve Hannah wrote:
I'm unable to reproduce this issue on iPhone 6S running 11.1.2 or with Xcode simulator iPhone 6S 11.2

Have you tried this on the latest builds?  There was a change 15 days ago that may have affected this use case (in a good way).

Best regards

Steve
On Mon, Mar 19, 2018 at 9:56 PM, Shai Almog <shai....@gmail.com> wrote:
Odd, I'll try to reproduce this. Can you file an issue?

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit https://groups.google.com/d/msgid/codenameone-discussions/d041b769-08c3-479a-a586-1f21c3b9dea1%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Steve Hannah

unread,
Mar 21, 2018, 9:07:33 AM3/21/18
to codenameone...@googlegroups.com
Thanks.  That helps.  I am able to reproduce it now.

Steve

Hi,

Cheers,
Nick
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsubscr...@googlegroups.com.



--
Steve Hannah
Software Developer
Codename One

--
You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to codenameone-discussions+unsub...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.

For more options, visit https://groups.google.com/d/optout.

Steve Hannah

unread,
Mar 21, 2018, 3:24:50 PM3/21/18
to codenameone...@googlegroups.com
This is fixed now.  https://github.com/codenameone/CodenameOne/commit/7e0d0752f3a06730d42ba71e78dcf8a7fd6dca68
It will be available in the next server update.

Steve




--
Steve Hannah
Software Developer
Codename One
Reply all
Reply to author
Forward
0 new messages