[PhoneGap] orientationchange event does not fire in ios(v1.6.0)

88 views
Skip to first unread message

谭恒

unread,
Apr 10, 2012, 1:52:49 PM4/10/12
to phon...@googlegroups.com
Test with a simple:

document.addEventListener('orientationchange',
function(){console.log('orientationchange!')})

in deviceready.

Am i missing something or it's a bug?

Matthew N

unread,
Apr 10, 2012, 1:59:12 PM4/10/12
to phonegap
I do not know if it's a bug or not, but I use Phonegap 1.4 and it does
not fire for me either.

Instead I am using the orientation detection from JQuery Mobile 1.1
rc1.

Shazron

unread,
Apr 10, 2012, 2:03:09 PM4/10/12
to phon...@googlegroups.com
Just re-tested it again, it works. By default a new app only supports
portrait, you have to enable the other orientations. Click on your
project icon, then Summary.

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com

谭恒

unread,
Apr 10, 2012, 3:09:04 PM4/10/12
to phon...@googlegroups.com
I did enabled all the orientations.And when i rotate the simulator,
the screen rotate correctly, but orientationchange event just not
fire.

That's happen to iphone 4.3 simulator, but when i change to 5.0/5.1
simulator, orientationchange did get fired.

I am not good at ios develop, am i missing something? And I use xcode 4.3.

Sorry for poor english.

2012/4/11 Shazron <sha...@gmail.com>:

谭恒

unread,
Apr 13, 2012, 8:35:47 AM4/13/12
to phon...@googlegroups.com
Checked again and still can't get orientationchange event fired in
iphone 4.3 simulator.
I notice that in CDVViewController.m, in fuction
didRotateFromInterfaceOrientation, these is a " TODO: update JS
references here". Unfinished code?

Shazron

unread,
Apr 13, 2012, 11:04:24 AM4/13/12
to phon...@googlegroups.com

谭恒

unread,
Apr 13, 2012, 2:50:54 PM4/13/12
to phon...@googlegroups.com
I have corrected that line to lower-case, recompile, and
orientationchange event still not being fired in ios4.3.
Missing some steps?
Reply all
Reply to author
Forward
0 new messages