我在下面找到了这个方向测试代码,寻找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 mode, sets the body's class attribute to portrait. Consequently, all style definitions matching the body[class="portrait"] declaration
in the iPhoneOrientation.css file will be selected and used to style "Handling iPhone or …Run Code Online (Sandbox Code Playgroud) 在Phonegap中我遇到了这个问题,如果我们将移动设备的字体大小从设置更改为正常到大,那么应用于应用程序的css会中断.
那么如何克服这个问题呢?我搜索了很多,但无法找到任何有关它的解决方案.
任何帮助或建议都会有所帮助.
当设备字体大小正常时,它工作正常. 图片在这里