Closed
Description
https://github.com/apache/incubator-cordova-ios/commit/d8575d7eece28ec2c90de4b448af729accaf2567 added new semantics for screen orientation and broke childbrowser
cc @shazron
Metadata
Metadata
Assignees
Labels
No labels
https://github.com/apache/incubator-cordova-ios/commit/d8575d7eece28ec2c90de4b448af729accaf2567 added new semantics for screen orientation and broke childbrowser
cc @shazron
Activity
shazron commentedon Sep 20, 2012
I'm fixing this - don't know how this is synced to phonegap-plugins, i'll fix both and send a pr here
shazron commentedon Sep 21, 2012
Updated ChildBrowser in phonegap-plugins: phonegap/phonegap-plugins@d4ce61d
Tested on iOS 5 and iOS 6.
max-mapper commentedon Sep 21, 2012
awesome! thanks shaz
regrunge commentedon Sep 27, 2012
if App in landscape, after closing childbrowser the view resizes wrongly with a black rectangle on the right, like if it was in portrait (ipad3 ios6). found many with this bug, where could be the bug? i'd love to help but i need some directions on the Cordova 2.0 vs. 2.1 orientation issue, it's still not clear to me
elijnzaad commentedon Oct 2, 2012
I'm experiencing the same problem as regrunge reported after applying an update to MainViewController.m. This update corrects the viewport offset for iOS6 as posted by petersjay:
(void)viewWillAppear:(BOOL)animated
{
// Set the main view to utilize the entire application frame space of the device.
// Change this to suit your view's UI footprint needs in your application.
self.view.frame = [[UIScreen mainScreen] applicationFrame];
[super viewWillAppear:animated];
}
Adding this results in the behavior described by regrunge. Removing it results in the top of the view disappearing behind the iOS statusbar, but will leave the orientation correct after returning from ChildBrowser.
aklivingston commentedon Oct 6, 2012
Same problem as regrunge (iPad 3, 5.1.1)
regrunge commentedon Oct 6, 2012
I've reset the self.view.frame in MainViewController.m like this:
(void)viewWillAppear:(BOOL)animated
{
// Set the main view to utilize the entire application frame space of the device.
// Change this to suit your view's UI footprint needs in your application.
self.view.frame = CGRectMake(0,0,[[UIScreen mainScreen] applicationFrame].size.height,[[UIScreen mainScreen] applicationFrame].size.width);
[super viewWillAppear:animated];
}
seems to work if landscape only, but please an expert that could test it? maybe with an if statement checking the orientation?
regrunge commentedon Oct 6, 2012
ok i've tried to make the IF statement:
{
if(self.interfaceOrientation > 2){
// Set the main view to utilize the entire application frame space of the device.
// Change this to suit your view's UI footprint needs in your application.
self.view.frame = CGRectMake(0,0,[[UIScreen mainScreen] applicationFrame].size.height,[[UIScreen mainScreen] applicationFrame].size.width);
} else {
self.view.frame = [[UIScreen mainScreen] applicationFrame];
}
[super viewWillAppear:animated];
}
elijnzaad commentedon Oct 8, 2012
Thanks regrunge, the IF statement works for me!
regrunge commentedon Oct 8, 2012
Cool now I got a similar problem with the barcodescanner ;( ! I read about child views but that little trick doesn't work on the barcode. I f only I knew objective-c....
aklivingston commentedon Oct 8, 2012
Will childbrowser be updated to include this fix?
regrunge commentedon Oct 8, 2012
I have actually "hacked" Cordova not Childbrowser, and I don't know what are they doing for orientation's problems in Cordova (Phonegap).
alunny commentedon Oct 9, 2012
Oh this thing.
Looks like @shazron's patch doesn't apply easily - I'll port the relevant parts into here and close when done.
@shazron: do you know what versions of Cordova the patched version works with?
2 remaining items