openGeeksLab / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

Keyboard showing scrolls incorrectly in landscape orientation, when landscape is not supported (ios.keyboardOpen=false) #1378

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Please clearly state whether the issue relates to a device/the simulator or
the tools.
If related to a device be sure to specify exactly which device with as much
details as possible.

The problem happens on iOS when iPhone is in landscape mode, but app supports 
only portrait mode. And build argument ios.keyboardOpen=false

What steps will reproduce the problem?
1. Rotate your phone to landscape mode
2. Tap on a lower textfield, which editing needs screen scrolling 

What is the expected output? What do you see instead?

The view should scroll to show the edited field, but it scrolls in opposite 
direction and the field is not visible at all (see attached screenshot).

What version of the product are you using? On what operating system?

the latest build server

Please provide any additional information below.

I don't have a clean solution for the problem, but when only iPad supports 
landscape, then the problem can be solved by modifying 
CodenameOne_GLViewController.m's method shouldAutorotate beginning to like this:

- (BOOL)shouldAutorotate {
    UIInterfaceOrientation interfaceOrientation = [[UIDevice currentDevice] orientation];
    upsideDownMultiplier = 1;

    if (!isIPad()) {
        //extra: if not iPad, then do not change upsideDownMultiplier 
        return NO;
    }

PS. There is also another related problem on the new iOS VM - build argument 
ios.interface_orientation=UIInterfaceOrientationPortrait has no effect, so I 
had set the only supported device orientation to Portrait in XCode. 

Original issue reported on code.google.com by jaanus.h...@gmail.com on 27 Feb 2015 at 9:21

Attachments: