I have Html File Containing a Scroll Division. When I add this HTML in WebView, it doesn't shows the scroll-bar for that div.
I have code in Html file.
// some Html code
<table style="border: 3px solid black;" align="center">
<tr>
<td ><div style="width: 100%; height: 50px; overflow: auto; padding:0px; "> <div>
put returns between paragraphs
► for linebreak add 2 spaces at end
► _italic_ or **bold**
► indent code by 4 spaces
► backtick escapes `like _so_`
► quote by placing > at start of line
► to make links
<http://foo.com>
[foo](http://foo.com)
► basic HTML also allowed
</div></td>
</tr>
</table>
// some Html code
When I add This Html file in WebView in xml File.
code of XMl is...
// some Html code
<RelativeLayout
android:id="@+id/webLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/buttonLayout"
android:layout_below="@+id/titleLayout" >
<WebView
android:id="@+id/webViewMain"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>
</RelativeLayout>
// some Html code
It Works fine but doesn't shows the Scroll-bar for that Div which was added in Html file
Scrolling a div with overflow:auto
is currently not available on the Android.
But you can achieve the same with some work around using a combination of HTML, JavaScript, and CSS. See this link for the details.
Another solution is, you can use the iScroll library.
And for your information, here is a nice comparison of what may or may not and how work on various mobile browsers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With