phonegap 2.2 orientation change does not resize app

后端 未结 4 1822
梦如初夏
梦如初夏 2021-02-01 19:50

I didn\'t have this problem on previous versions of Phonegap. But in 2.2, when I change the orientation, it doesn\'t update the uiwebview.

Does phonegap not

相关标签:
4条回答
  • 2021-02-01 20:21

    I have also have same issue in ios phonegap ....

    Just go and update x-code project file (IOS Application target ) change or update support interface orientation and check it all orientation .

    it's work well ...

    0 讨论(0)
  • 2021-02-01 20:28

    To add to Stephan's answer, if you need to do anything special when the orientation changes, you can set a callback function to:

    window.onorientationchange

    0 讨论(0)
  • 2021-02-01 20:30
    window.addEventListener(
        "orientationchange",
        function() {
            // Announce the new orientation number
            location.reload();
        }, false );
    
    0 讨论(0)
  • 2021-02-01 20:39

    This is not an issue with the WebView getting updated but with the meta tag in the index.html's document head.

    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
    

    After removing the unnecessary height=device-height everything works just fine

    <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, target-densitydpi=device-dpi" />
    

    landscape is supported

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