Impossible to hide navigation bars in Safari iOS 7 for iPhone/iPod touch

前端 未结 8 1351
谎友^
谎友^ 2020-11-28 18:27

I don\'t believe there is any solution to hide bars programmatically using javascript/css/html, but let me try to describe a problem. We are the team of mobile game develope

8条回答
  •  醉梦人生
    2020-11-28 19:06

    Hopefully this helps someone, but I didn't want to set my viewport width=device-width.. because its 480px on iphone 4.. and I want my game to be at 800px for all devices.

    And if you don't set it, then minimal-ui doesn't register.

    My work around is doing:

    And then changing the viewport once the page is loaded:

      $(window).load(function(){
        $('meta[name=viewport]').attr('content','width=800, maximum-scale=1')
      });
    

    I'm pretty shocked it works. The address bar and lower UI buttons only appear if the user clicks the top/bottom of the screen. Love it now.

提交回复
热议问题