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

前端 未结 8 1352
谎友^
谎友^ 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:07

    EDIT 2:

    Does not work since iOS 7.1

    EDIT:

    Some games have adopted an overlay that hints the player to scroll away the bars and then locks scrolling until bars pop out again. In this case position: fixed helps a lot, as it stabilizes the movement (can't explain it better, just have to try it for yourself). This game is a good example of such approach:

    www.paf.com/mobile/launch/flowers.html (sorry, can't post more than 2 links)

    Recently I have also stumbled upon a hack that deactivates navigation bar triggering for the top area. All you have to do is add a random element to your DOM with following styles:

    z-index: 100000; /* should be bigger than everything else */
    position: fixed;
    overflow: scroll;
    -webkit-overflow-scrolling: touch;
    


    Read more about it here.

提交回复
热议问题