How to android cover the entire width of the screen, via html + css + js. In version 4.0 it works fine, in 2.0 some kind of white bar appears where there should be a scrollbar

The trick is that in the options.

1) Browser and Denver

2) Denver and the browser of the smartphone displays all the rules, and when the HTML + CSS + JS compilation is such a gov .. alt text

body{ widht: 100%; //.... overflow:hidden; background-image: url(../picture/fon.png); background-repeat: no-repeat; background-size: 100% 100%; } 
  • one
    including soft buttons below? - KoVadim
  • But where is the example that would spy on a real device? - KoVadim
  • The example is not allowed to give (well, just look, the width is not calculated normally. But on the 4th android it works ok, but on the 2nd it is not ok. overflow: hidden; also in the handler there is document.body.style.width = document.documentElement = screen. availWidth - Zow
  • Well, I understand the secrecy and the like. Is it difficult to make a minimal example on your knee and put it on any nation / ukoz? But if it is impossible, then you will have to do it yourself. - KoVadim
  • @KoVadim updated here, notice that in 4.0 everything works fine, and in 2.0 a white stripe appears - Zow

1 answer 1

Damn with my knowledge of English. I understand that in widndow.onload you need to drive webview.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY); ?

This line is necessary for the widget itself in the android attachment to enter. so that the space for the scroll bar was not given, and not the site code to change.

  • Yes, that's right - thank G * gu, that there are people who know / think - well done! - Barmaley