Image rendered in Android Webview with zero height

63 Views Asked by At

I am trying to load a URL in webview, but it just loads a blank page.

Upon inspecting the webview in Chrome, I got to know that the actual size (1080 x 1080) and rendered size (320 x 0) are different.

enter image description here

Due to the 0 rendered height, I am unable to see anything on the webview.

Can someone please guide me through this? Am I missing something in setting my webview correctly? Here is my webview configuration:

  webView.settings.javaScriptEnabled = true
  webView.settings.loadWithOverviewMode = true
  webView.settings.useWideViewPort = true
  webView.settings.layoutAlgorithm = WebSettings.LayoutAlgorithm.SINGLE_COLUMN
  webView.settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
  webView.settings.domStorageEnabled = true
  webView.settings.allowFileAccessFromFileURLs = true
  webView.settings.allowUniversalAccessFromFileURLs = true
  webView.settings.loadsImagesAutomatically = true
  webView.scrollBarStyle = View.SCROLLBARS_INSIDE_OVERLAY
  webView.settings.builtInZoomControls = true
0

There are 0 best solutions below