JQuery Mobile Beta 1 is not resizing the screen on iphone when rotated to landscape

后端 未结 1 1361
夕颜
夕颜 2021-01-05 20:24

I am writing mobile app with JQUery Mobile Beta 1 and was expecting that the screen should adjust automatically on iphone when rotated from portrait to landscape and vice ve

1条回答
  •  时光说笑
    2021-01-05 20:54

    In your document instead of doing this:

     
    

    Do this:

    
    

    Why this works

    When your device oritentation changes (i.e. when you rotate it) MobileSafari will zoom into the page before it resizes the viewport. So the zoom is applied based on the portrait screen width when it should just let the page resize on its own. By setting both initial and maximum scale to 1 we disable zooming. So MobileSafari can't zoom into your page incorrectly when you rotate, thereby fixing the problem.

    Also see: jQuery Mobile bug report

    0 讨论(0)
提交回复
热议问题