Android: give a webview rounded corners?

前端 未结 6 1852
隐瞒了意图╮
隐瞒了意图╮ 2020-12-17 14:27

I\'m trying to give my webView rounded corners.

Here is my code:

rounded_webview.xml:




        
6条回答
  •  攒了一身酷
    2020-12-17 14:38

    This is a little quirk of Webview, it has a default background color of white, drawn in front of any drawables. You'll need to use the following code to make it transparent and show your drawable background:

    WebView webview = (WebView)findViewById(R.id.webView1);        
    webview.setBackgroundColor(0);
    

提交回复
热议问题