Skip to content

broken as of incubator-cordova-ios d8575d7ee, needs screen orientation api updates #20

Closed
@max-mapper

Description

@max-mapper

https://github.com/apache/incubator-cordova-ios/commit/d8575d7eece28ec2c90de4b448af729accaf2567 added new semantics for screen orientation and broke childbrowser

cc @shazron

Activity

shazron

shazron commented on Sep 20, 2012

@shazron

I'm fixing this - don't know how this is synced to phonegap-plugins, i'll fix both and send a pr here

shazron

shazron commented on Sep 21, 2012

@shazron

Updated ChildBrowser in phonegap-plugins: phonegap/phonegap-plugins@d4ce61d

  1. Fixed iOS 6 orientation issue
  2. ARC/non-ARC compatibility
  3. Uncrustified

Tested on iOS 5 and iOS 6.

max-mapper

max-mapper commented on Sep 21, 2012

@max-mapper
Author

awesome! thanks shaz

regrunge

regrunge commented on Sep 27, 2012

@regrunge

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

elijnzaad commented on Oct 2, 2012

@elijnzaad

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

aklivingston commented on Oct 6, 2012

@aklivingston

Same problem as regrunge (iPad 3, 5.1.1)

regrunge

regrunge commented on Oct 6, 2012

@regrunge

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

regrunge commented on Oct 6, 2012

@regrunge

ok i've tried to make the IF statement:

  • (void)viewWillAppear:(BOOL)animated
    {
    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

elijnzaad commented on Oct 8, 2012

@elijnzaad

Thanks regrunge, the IF statement works for me!

regrunge

regrunge commented on Oct 8, 2012

@regrunge

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

aklivingston commented on Oct 8, 2012

@aklivingston

Will childbrowser be updated to include this fix?

regrunge

regrunge commented on Oct 8, 2012

@regrunge

I have actually "hacked" Cordova not Childbrowser, and I don't know what are they doing for orientation's problems in Cordova (Phonegap).

alunny

alunny commented on Oct 9, 2012

@alunny
Owner

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?

reopened this on Oct 9, 2012

2 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      broken as of incubator-cordova-ios d8575d7ee, needs screen orientation api updates · Issue #20 · alunny/ChildBrowser