Android WebView image implementation adaptive method

  • 2020-06-19 11:44:11
  • OfStack

An example of WebView image in Android is presented. Share to everybody for everybody reference. Specific implementation methods are as follows:

WebSettings ws = tv.getSettings();

With this attribute, the html image will appear as a single column and will not deform and take up space elsewhere


ws.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
// Start with the minimum value of the zoom display 
webView.setInitialScale(5);
//  Set support for zooming 
webSettings.setSupportZoom(true);
//  Sets the display of the zoom tool 
webSettings.setBuiltInZoomControls(true);

I hope this article has been helpful for your Android programming.


Related articles: