一开始使用shape的方式实现,发现不行,网页出来以后就会填充满
后来使用搜索引擎,看到其他人实现的webview圆角效果,连接 http://blog.csdn.net/zxwd2015/article/details/64554653
实测,性能太差,卡顿明显
于是自己重写
看了下他的代码,搞了4个path,各种moveTo和lineTo,我就想能不能把4个path合成1个path
或者能不能找到一个函数可以搞定的,找到了addRoundRect函数
呃,这就很舒服
链接:
http://www.cnblogs.com/everhad/p/6161083.html
http://blog.csdn.net/qiushi_1990/article/details/53188554
所以,自己改了下他们的代码
完整代码如下:
↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
/** * 圆角webview */ public class CornersWebView extends WebView { private float top_left = 0; private float top_right = 0; private float bottom_left = 0;