title: Android: WebView load image in center
body: <p>I want to load an image at the web view, but it shows all at top_left of the web view. My picture is on the internet not local.</p>
  
  <pre><code>gifView.loadUrl(mImageUrl); 
  gifView.setWebViewClient(new WebViewClient() {
  
          @Override
          public void onPageFinished(WebView view, String url) {
              view.getSettings().setLoadsImagesAutomatically(true);
              if (mProgressBar != null) {
                  mProgressBar.setVisibility(View.GONE);
              }
          }
  
          @Override
          public void onPageStarted(WebView view, String url, Bitmap favicon) {
              if (mProgressBar != null) {
                  mProgressBar.setVisibility(View.VISIBLE);
              }
          }
  
      });
  </code></pre>
  
  <p>Here is my xml::: </p>
  
  <pre><code>  &lt;WebView
                       android:id="@+id/gif_image"
                       android:background="@null"
                       android:layout_gravity="center"
  
                      android:layout_width="fill_parent"
                      android:layout_height="fill_parent" /&gt;
  </code></pre>
  
  <p>Edit:i used:</p>
  
  <pre><code>   String HTML_FORMAT = "&lt;html&gt;&lt;body style=\"text-align: center; background-color: null; vertical-align: middle;\"&gt;&lt;img src = \"%s\" /&gt;&lt;/body&gt;&lt;/html&gt;";
  
           final String html = String.format(HTML_FORMAT, mImageUrl);
  
           gifView.loadDataWithBaseURL("", html, "text/html", "UTF-8", "");
  </code></pre>
  
  <p>but my image only Horizontal Center，how to center</p>