In WebView, you can scroll a webpage horizontally and vertically, but it is better to fix the horizontal bar by adjust the size of the contents so that the contents don't expand the View. I did that but I found there is some extra spaces in the WebView to make view scrollable horizontally. First, I think it is related to CSS and margin, so I add
* {margin:0px; padding: 0px;}
But it doesn't work. Finally, I realize that is the problem of the vertical scroll that occupies some spaces. To solve this problem, you can set the scrollbar style to display the scrollbars inside the content area.
webview.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
No comments:
Post a Comment