1
如何在iOS上使用Phonegap正确检测方向变化?
我在下面找到此定向测试代码,以查找JQTouch参考资料。这可以在移动Safari上的iOS模拟器中正常运行,但在Phonegap中无法正确处理。我的项目遇到了与杀死该测试页相同的问题。有没有办法在Phonegap中使用JavaScript来感知方向变化? window.onorientationchange = function() { /*window.orientation returns a value that indicates whether iPhone is in portrait mode, landscape mode with the screen turned to the left, or landscape mode with the screen turned to the right. */ var orientation = window.orientation; switch (orientation) { case 0: /* If in portrait …