cocos2dx2.2.5 on ios8 cceditbox make the main view appear error

hi all

the cocos2dx version 2.2.5 has some problem with cceditbox on ios8 sdk
you guys can see my picture, just run the testcpp project and choose editboxtest

i have found some problem with the EAGLView frame is not right after openKeyboard, anyone had already fixed this bug please tell me how to do. i already try some method to hack the code, but i thank it is not the right answer.

thanks

me too… and waiting for answer…

It is really weird, does anyone know how to resolve this issue?

somebody help

I fixed it ! Just replace [[UIApplication sharedApplication] statusBarOrientation] with getFixedOrientation([[UIApplication sharedApplication] statusBarOrientation]) twice in /cocos2dx/platform/ios/EAGLView.mm

And add the following function:

UIInterfaceOrientation getFixedOrientation(UIInterfaceOrientation statusBarOrientation)
{
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
{
statusBarOrientation = UIInterfaceOrientationPortrait;
}
return statusBarOrientation;
}

The problem comes from UIScreen bounds and also keyboard frame notifications becoming orientation dependent with iOS8 (general problem described in stackoverflow)
Thanks, dylan, for your fix. Have you sent a pull request so it gets integrated into cocos2dx?

Here is the PR: https://github.com/cocos2d/cocos2d-x/pull/8149
Thanks for your solution: @dylan465

Not yet,but @owen did it :smile:

So happy for my code could be a part of Cocos2d-x :blush: Thanks @owen

thanks @dylan465 @owen i can replace my weird code now

thanks for the fix

Please take care of the situation that compiled with ios sdk below 8.

Is there anything wrong with ios sdk below 8?

I have tested on ios7, it works. If I’m wrong here, please point it out.

Thanks.

I mean if somebody compile this code with an older xcode using sdk below 8,then run on device 8.x may not require this modification.
I have not test it,but I just figure out this problem in my games developed with some other engine, as far as I know,older version compiled with xcode 5 using 7.1 works just fine on device 8.x.

Also,this problem take place in several situations, for example, show
Alertview,open leaderboard.
My situation is a landscape app hold the device in portrait and then show an uialertview.
I suggest test all these situations.

@alexzhengyi

Thanks, I will tested later.

I have just tested an uialertview in coco2d x 3.3.
the steps:
1 run the app in portrait
2 rotate the device to landscape
3 click a button to open an uialertview
4 the result is some part of scene is cropped.