How do I get rid of Android notification bar

Get help using Construct 2

Post » Wed Oct 22, 2014 9:23 pm

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?
B
28
S
2
G
3
Posts: 61
Reputation: 2,523

Post » Wed Oct 22, 2014 10:18 pm

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.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Wed Oct 22, 2014 10:43 pm

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
B
38
S
11
G
5
Posts: 485
Reputation: 5,340


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 6 guests