I've been working on programming a basic webcomic app lately and have been having issues with how webview is displaying the comics. The images themselves load fine, however there is always excess whitespace above or to the side of the image, with the image always being positioned at the top left corner of the webview. Also, typically the webview is zoomed into the image a certain degree, which is a problem as the comics vary in dimensions.
I would like to have the image load so that it is centered, adjusted based on height or width (whichever is appropriate) so that the entire image is visible, and if possible eliminate the whitespace. Unfortunately I cannot provide any screenshots of the problem because for whatever reason none of the emulators can run the app.
As far as code goes I have just the following:
<WebView
android:id="@+id/webView1"
android:layout_width="wrap_content"
android:layout_height="300dp"
android:layout_below="@+id/textView1"
android:layout_gravity="center"
android:layout_centerHorizontal="true" />
In the class my code is as such with image being a string that contains the image URL which I pulled from the page's HTML:
WebView myWebView = (WebView) findViewById(R.id.webView1);
myWebView.loadUrl(image);