自定义webview,根据网页大小确定webview大小

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
public class MyWebView extends WebView {
 
 
    public MyWebView(Context context) {
        super(context);
    }
 
    public MyWebView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);
    }
 
    public MyWebView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }
 
    protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
        int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2,
                MeasureSpec.AT_MOST);
        super.onMeasure(widthMeasureSpec, expandSpec);
    }
 
 
 
}
上一篇:SharePoint 判断用户是否在字段"人员和组"里面


下一篇:Android中几种图像特效处理的集锦!!!