How to get transparent background of webView for 4.0 version

前端 未结 3 814
一生所求
一生所求 2020-12-18 18:43

I am looking for a piece of code which is able to get a transparent background in a WebView for version 4.0 and above. My code is working fine with version 2.3

3条回答
  •  情话喂你
    2020-12-18 19:12

    If webview is scrolable:

    Add this to the Manifest:

    android:hardwareAccelerated="false"
    

    OR

    Add the following to WebView in the layout:

    android:background="@android:color/transparent" android:layerType="software"
    

    Add the following to the parents scroll view:

    android:layerType="software"
    

提交回复
热议问题