My layout file defines a WebView, underneath which there are some fixed height buttons.
@Sergii's code didn't work for me, but following does
mWebView.setWebViewClient(new mWebViewClient(){
@Override
public void onPageFinished(WebView web, String url) {
web.loadUrl("javascript:(function(){ document.body.style.paddingTop = '55px'})();");
}
});
You can change paddingTop
to paddingBottom, paddingRight, paddingLeft
too. Change the 55px
value to whatever you desire. Additionally, enable JavaScript for your webview
webView.settings.javaScriptEnabled = true