Android WebView background color

前端 未结 8 1883
情话喂你
情话喂你 2020-12-29 00:47

I am adding to my layout a WebView to display justified text. I want to set the background of the WebView to be transparent to appear like a textView. Here\'s what I did:

8条回答
  •  一整个雨季
    2020-12-29 01:27

    You must put this in the XML code :

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

    for your web view like this for example :

    
    

    and after this you must go to Java code and write this before loadUrl :

    yourWebView.setBackgroundColor(Color.TRANSPARENT);
    

提交回复
热议问题