alunny / ChildBrowser

cross-platform ChildBrowser plugin for PhoneGap/Cordova
104 stars 134 forks source link

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

Closed max-mapper closed 11 years ago

max-mapper commented 11 years ago

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

cc @shazron

shazron commented 11 years ago

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

shazron commented 11 years ago

Updated ChildBrowser in phonegap-plugins: https://github.com/phonegap/phonegap-plugins/commit/d4ce61db03cd4f9b69f075b8ca148637c04f713c

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

Tested on iOS 5 and iOS 6.

max-mapper commented 11 years ago

awesome! thanks shaz

regrunge commented 11 years ago

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 commented 11 years ago

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:

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 commented 11 years ago

Same problem as regrunge (iPad 3, 5.1.1)

regrunge commented 11 years ago

I've reset the self.view.frame in MainViewController.m like this:

seems to work if landscape only, but please an expert that could test it? maybe with an if statement checking the orientation?

regrunge commented 11 years ago

ok i've tried to make the IF statement:

elijnzaad commented 11 years ago

Thanks regrunge, the IF statement works for me!

regrunge commented 11 years ago

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 commented 11 years ago

Will childbrowser be updated to include this fix?

regrunge commented 11 years ago

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

alunny commented 11 years ago

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?

mygithub747 commented 11 years ago

I am running into strange issue, when the ChildBrowser closes the main view inherits the ChildBrowser dimensions, so for e.g if the MainView had a long long HTMl page and was able to scroll and after clicking a link to open ChildBrowser and then closing it causes MainView to not scroll as if the mainview dimension gets locked in. Any ideas how to resolve this. I tried some of the fixes mentioned above but doesn't work.