How do I get rid of Android notification bar

0 favourites
  • 3 posts
From the Asset Store
Custom animated Health Bar - check youtube video to make it yourself
  • I have built a small android game using Crosswalk and it runs on my Samsung Galaxy Tab 2 without a hitch.The only thing I don't like is that the notification bar is still visible at the top of the screen.Is there any way of getting rid of this either during the programming in Construct 2 or during the build in Crosswalk?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Add the following to the lines to the index.html file:

    <script>

    if(navigator.userAgent.match(/Android/i)){

    window.scrollTo(0,1);

    }

    </script>

    ------------------------------------

    <script>

    // When ready...

    window.addEventListener("load",function() {

    // Set a timeout...

    setTimeout(function(){

    // Hide the address bar!

    window.scrollTo(0, 1);

    }, 0);

    });

    </script>

    ---------------------------------------------------------------------

    <script>

    function hideAddressBar(){

    if(document.documentElement.scrollHeight<window.outerHeight/window.devicePixelRatio)

    document.documentElement.style.height=(window.outerHeight/window.devicePixelRatio)+'px';

    setTimeout(window.scrollTo(1,1),0);

    }

    window.addEventListener("load",function(){hideAddressBar();});

    window.addEventListener("orientationchange",function(){hideAddressBar();});

    </script>

    --------------------------------------------

    I use all 3 together to remove the address bar.

  • did you check the Fullscreen option under the build settings? if you use crosswalk to build the app you have to check it on the scecond tab on that menu!

    it works on every device i tested

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)