webView

作者: 奔跑的图腾 | 来源:发表于2018-03-13 09:46 被阅读26次

    加载方法:public void loadData (String data, String mimeType, String encoding)
    参数说明:
    data 字符串String形式的数据 可以通过base64编码而来
    mineType data数据的 MIME类型, e.g. 'text/html'
    encoding data数据的编码格式

    mWebView.requestFocus();//获取焦点 
    
    setJavaScriptEnabled(true);  //支持js
    
    setPluginsEnabled(true);  //支持插件 
    
    setUseWideViewPort(false);  //将图片调整到适合webview的大小 
    
    setSupportZoom(true);  //支持缩放 
    
    setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN); //支持内容重新布局  
    
    supportMultipleWindows();  //多窗口 
    
    setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK);  //关闭webview中缓存 
    
    setAllowFileAccess(true);  //设置可以访问文件 
    
    setNeedInitialFocus(true); //当webview调用requestFocus时为webview设置节点
    
    webview webSettings.setBuiltInZoomControls(true); //设置支持缩放 
    
    setJavaScriptCanOpenWindowsAutomatically(true); //支持通过JS打开新窗口 
    
    setLoadWithOverviewMode(true); // 缩放至屏幕的大小
    
    setLoadsImagesAutomatically(true);  //支持自动加载图片
    
    setDefaultFontSize 设置默认的字体大小
    
    

    相关文章

      网友评论

        本文标题:webView

        本文链接:https://www.haomeiwen.com/subject/dganfftx.html